From 807784c8acaae82280f7e094864ebb5398e8d62b Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 14:41:44 +0900 Subject: [PATCH 01/55] Support portable IRIs in vocab codecs Fedify now parses ap: and ap+ef61: IRIs with decoded DID authorities through shared runtime helpers, and generated vocabulary code formats those values with canonical ap+ef61: output. The generated decoder also avoids reusing raw JSON-LD caches for portable IRI inputs so default serialization uses the updated codec. https://github.com/fedify-dev/fedify/issues/826 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/mod.ts | 3 + packages/vocab-runtime/src/url.test.ts | 46 + packages/vocab-runtime/src/url.ts | 71 + .../src/__snapshots__/class.test.ts.deno.snap | 2845 +++++++---------- .../src/__snapshots__/class.test.ts.node.snap | 2845 +++++++---------- .../src/__snapshots__/class.test.ts.snap | 2845 +++++++---------- packages/vocab-tools/src/class.ts | 3 + packages/vocab-tools/src/codec.ts | 27 +- packages/vocab-tools/src/type.ts | 27 +- packages/vocab/src/vocab.test.ts | 120 + 10 files changed, 3739 insertions(+), 5093 deletions(-) diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index 9e7967c9e..cdb58f543 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -50,9 +50,12 @@ export { type PropertyPreprocessorContext, } from "./preprocessor.ts"; export { + canParseIri, expandIPv6Address, + formatIri, isValidPublicIPv4Address, isValidPublicIPv6Address, + parseIri, UrlError, validatePublicUrl, } from "./url.ts"; diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 35aad4658..7c7fbe420 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -1,13 +1,59 @@ import { deepStrictEqual, ok, rejects } from "node:assert"; import { test } from "node:test"; import { + canParseIri, expandIPv6Address, + formatIri, isValidPublicIPv4Address, isValidPublicIPv6Address, + parseIri, UrlError, validatePublicUrl, } from "./url.ts"; +test("parseIri() accepts portable ActivityPub URI schemes", () => { + const cases = [ + "ap://did:key:z6Mkabc/actor", + "ap://did%3Akey%3Az6Mkabc/actor", + "ap+ef61://did:key:z6Mkabc/actor", + "ap+ef61://did%3Akey%3Az6Mkabc/actor", + "AP+EF61://did:key:z6Mkabc/actor", + ]; + for (const iri of cases) { + ok(canParseIri(iri)); + deepStrictEqual( + parseIri(iri), + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + ); + } +}); + +test("parseIri() preserves existing URL parsing behavior", () => { + deepStrictEqual( + parseIri("/actor", new URL("https://example.com/users/alice")), + new URL("https://example.com/actor"), + ); + deepStrictEqual( + parseIri("at://did:plc:example/record"), + new URL("at://did%3Aplc%3Aexample/record"), + ); + ok(!canParseIri("ap://not-a-did/actor")); +}); + +test("formatIri() emits canonical portable ActivityPub URI syntax", () => { + const cases = [ + new URL("ap://did%3Akey%3Az6Mkabc/actor"), + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + ]; + for (const iri of cases) { + deepStrictEqual(formatIri(iri), "ap+ef61://did:key:z6Mkabc/actor"); + } + deepStrictEqual( + formatIri(new URL("https://example.com/actor")), + "https://example.com/actor", + ); +}); + test("validatePublicUrl()", async () => { await rejects(() => validatePublicUrl("ftp://localhost"), UrlError); await rejects( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 0274e669f..b5db7649a 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -9,6 +9,77 @@ export class UrlError extends Error { } } +/** + * Checks whether the given string can be parsed as an IRI. + */ +export function canParseIri(iri: string, base?: string | URL): boolean { + try { + parseIri(iri, base); + return true; + } catch { + return false; + } +} + +/** + * Parses an IRI as a URL, including FEP-ef61 portable ActivityPub IRIs. + */ +export function parseIri(iri: string | URL, base?: string | URL): URL { + if (iri instanceof URL) { + return parsePortableIri(iri.href) ?? new URL(iri.href); + } + const portable = parsePortableIri(iri); + if (portable != null) return portable; + if (!URL.canParse(iri, base) && iri.startsWith("at://")) { + return parseAtUri(iri); + } + return new URL(iri, base); +} + +/** + * Formats a URL as an IRI, including FEP-ef61 portable ActivityPub IRIs. + */ +export function formatIri(iri: string | URL): string { + const parsed = parsePortableIri(iri instanceof URL ? iri.href : iri); + if (parsed == null) return iri instanceof URL ? iri.href : new URL(iri).href; + const authority = decodePortableAuthority(parsed.host); + return `ap+ef61://${authority}${parsed.pathname}${parsed.search}${parsed.hash}`; +} + +function parsePortableIri(iri: string): URL | null { + const match = iri.match( + /^(ap|ap\+ef61):\/\/([^/?#]*)([^?#]*)(\?[^#]*)?(#.*)?$/i, + ); + if (match == null) return null; + const authority = decodePortableAuthority(match[2]); + if (!authority.startsWith("did:")) { + throw new TypeError("Invalid portable ActivityPub IRI authority."); + } + return new URL( + `ap+ef61://${encodeURIComponent(authority)}${match[3]}${match[4] ?? ""}${ + match[5] ?? "" + }`, + ); +} + +function decodePortableAuthority(authority: string): string { + try { + return decodeURIComponent(authority); + } catch { + throw new TypeError("Invalid portable ActivityPub IRI authority."); + } +} + +function parseAtUri(uri: string): URL { + return new URL( + "at://" + + encodeURIComponent( + uri.includes("/", 5) ? uri.slice(5, uri.indexOf("/", 5)) : uri.slice(5), + ) + + (uri.includes("/", 5) ? uri.slice(uri.indexOf("/", 5)) : ""), + ); +} + /** * Validates a URL to prevent SSRF attacks. */ diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 3a126114c..33a330389 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -8,17 +8,20 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from \\"@opentelemetry/api\\"; import { canParseDecimal, + canParseIri, decodeMultibase, type Decimal, type DocumentLoader, encodeMultibase, exportMultibaseKey, exportSpki, + formatIri, getDocumentLoader, importMultibaseKey, importPem, isDecimal, LanguageString, + parseIri, parseDecimal, type RemoteDocument } from \\"@fedify/vocab-runtime\\"; @@ -9118,7 +9121,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9146,7 +9149,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9182,7 +9185,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9221,7 +9224,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9280,7 +9283,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9304,7 +9307,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9324,7 +9327,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9344,7 +9347,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9368,7 +9371,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9392,7 +9395,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const item = ( - v instanceof URL ? v.href : v instanceof Link ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Link ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9432,7 +9435,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9452,7 +9455,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9472,7 +9475,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9492,7 +9495,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9547,7 +9550,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9587,7 +9590,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9607,7 +9610,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9627,7 +9630,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9647,7 +9650,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9667,7 +9670,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9755,7 +9758,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9795,7 +9798,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -9811,7 +9814,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9831,7 +9834,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9851,7 +9854,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9869,7 +9872,7 @@ get urls(): ((URL | Link))[] { } result[\\"type\\"] = \\"Object\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -9880,7 +9883,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9895,7 +9898,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9910,7 +9913,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -9943,7 +9946,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9994,7 +9997,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10009,7 +10012,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10024,7 +10027,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10039,7 +10042,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10054,7 +10057,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10069,7 +10072,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10102,7 +10105,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10117,7 +10120,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10132,7 +10135,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10147,7 +10150,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10198,7 +10201,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10231,7 +10234,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10246,7 +10249,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10261,7 +10264,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10276,7 +10279,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10291,7 +10294,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10369,7 +10372,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push({ \\"@graph\\": element });; } @@ -10399,7 +10402,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -10414,7 +10417,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10429,7 +10432,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10444,7 +10447,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10457,7 +10460,7 @@ get urls(): ((URL | Link))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Object\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -10600,11 +10603,11 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -10875,7 +10878,7 @@ get urls(): ((URL | Link))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); @@ -10896,11 +10899,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _49BipA5dq9eoH8LX8xdsVumveTca_attachment.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _49BipA5dq9eoH8LX8xdsVumveTca_attachment.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -10944,11 +10943,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -10998,11 +10993,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11056,11 +11047,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3mhZzGXSpQ431mBSz2kvych22v4e_context.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3mhZzGXSpQ431mBSz2kvych22v4e_context.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11146,11 +11133,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _86xFhmgBapoMvYqjbjRuDPayTrS_generator.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _86xFhmgBapoMvYqjbjRuDPayTrS_generator.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11212,11 +11195,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11268,11 +11247,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11302,11 +11277,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11346,11 +11317,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _31k5MUZJsnsPNg8dQQJieWaXTFnR_location.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _31k5MUZJsnsPNg8dQQJieWaXTFnR_location.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11390,11 +11357,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11456,11 +11419,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _7UpwM3JWcXhADcscukEehBorf6k_replies.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _7UpwM3JWcXhADcscukEehBorf6k_replies.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11490,11 +11449,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11524,11 +11479,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11558,11 +11509,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11638,11 +11585,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _5chuqj6s95p5gg2sk1HntGfarRf_tag.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _5chuqj6s95p5gg2sk1HntGfarRf_tag.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11702,22 +11645,7 @@ get urls(): ((URL | Link))[] { const decoded = v != null && typeof v === \\"object\\" && \\"@id\\" in v && typeof v[\\"@id\\"] === \\"string\\" - && v[\\"@id\\"] !== \\"\\" ? v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl) : typeof v === \\"object\\" && \\"@type\\" in v + && v[\\"@id\\"] !== \\"\\" ? parseIri(v[\\"@id\\"], options.baseUrl) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, @@ -11747,11 +11675,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11781,11 +11705,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11815,11 +11735,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11849,11 +11765,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11958,11 +11870,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -12008,22 +11916,7 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.push(decoded); } @@ -12046,11 +11939,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -12080,11 +11969,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -12114,11 +11999,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -12133,7 +12014,10 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -13165,7 +13049,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Emoji\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\"}]; return result; } @@ -13184,7 +13068,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"http://joinmastodon.org/ns#Emoji\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -13302,11 +13186,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -13332,7 +13216,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -14075,7 +13962,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -14095,7 +13982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -14121,7 +14008,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -14139,7 +14026,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"ChatMessage\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -14160,7 +14047,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -14175,7 +14062,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { \\"@value\\": v.href } + { \\"@value\\": formatIri(v) } ); array.push(element);; } @@ -14194,7 +14081,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -14207,7 +14094,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"http://litepub.social/ns#ChatMessage\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -14325,11 +14212,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -14370,11 +14257,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -14407,7 +14290,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v[\\"@value\\"]); + const decoded = parseIri(v[\\"@value\\"]); if (typeof decoded === \\"undefined\\") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -14430,11 +14313,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -14449,7 +14328,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -17265,7 +17147,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -17280,7 +17162,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17295,7 +17177,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17310,7 +17192,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17325,7 +17207,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17340,7 +17222,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17353,7 +17235,7 @@ instruments?: (Object | URL)[];} } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Activity\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -17471,11 +17353,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -17652,11 +17534,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17706,11 +17584,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17740,11 +17614,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17774,11 +17644,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17808,11 +17674,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _25zu2s3VxVujgEKqrDycjE284XQR_origin.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _25zu2s3VxVujgEKqrDycjE284XQR_origin.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17842,11 +17704,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17861,7 +17719,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -18205,7 +18066,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"http://litepub.social/ns#EmojiReact\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -18323,11 +18184,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -18353,7 +18214,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -18674,7 +18538,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } result[\\"type\\"] = \\"PropertyValue\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\"}]; return result; } @@ -18719,7 +18583,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } values[\\"@type\\"] = [\\"http://schema.org#PropertyValue\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -18836,11 +18700,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -18855,7 +18719,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; @@ -18909,7 +18773,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -19283,7 +19150,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } result[\\"type\\"] = \\"om2:Measure\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -19325,7 +19192,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } values[\\"@type\\"] = [\\"http://www.ontology-of-units-of-measure.org/resource/om-2/Measure\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -19432,11 +19299,11 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -19451,7 +19318,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _27fgyFbosTtMAhuepJH8K3ZGURT6: (string)[] = []; @@ -19493,7 +19360,10 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -20243,7 +20113,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -20263,7 +20133,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -20281,7 +20151,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"AnnounceAuthorization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -20302,7 +20172,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -20317,7 +20187,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -20330,7 +20200,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://gotosocial.org/ns#AnnounceAuthorization\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -20448,11 +20318,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -20493,11 +20363,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -20527,11 +20393,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -20546,7 +20408,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -20784,7 +20649,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://gotosocial.org/ns#AnnounceRequest\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -20902,11 +20767,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -20932,7 +20797,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -21376,7 +21244,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -21503,11 +21371,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -21522,7 +21390,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike: (InteractionRule)[] = []; @@ -21612,7 +21480,10 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -22126,7 +21997,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -22141,7 +22012,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -22154,7 +22025,7 @@ get manualApprovals(): (URL)[] { } - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -22261,11 +22132,11 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -22280,7 +22151,7 @@ get manualApprovals(): (URL)[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval: (URL)[] = []; @@ -22296,22 +22167,7 @@ get manualApprovals(): (URL)[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.push(decoded); } @@ -22329,22 +22185,7 @@ get manualApprovals(): (URL)[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.push(decoded); } @@ -22352,7 +22193,10 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -23113,7 +22957,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -23133,7 +22977,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -23151,7 +22995,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"LikeAuthorization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -23172,7 +23016,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -23187,7 +23031,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -23200,7 +23044,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://gotosocial.org/ns#LikeApproval\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -23318,11 +23162,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -23363,11 +23207,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -23397,11 +23237,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -23416,7 +23252,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -23653,7 +23492,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://gotosocial.org/ns#LikeRequest\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -23771,11 +23610,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -23801,7 +23640,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -24495,7 +24337,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -24515,7 +24357,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -24533,7 +24375,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"ReplyAuthorization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -24554,7 +24396,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -24569,7 +24411,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -24582,7 +24424,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://gotosocial.org/ns#ReplyAuthorization\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -24700,11 +24542,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -24745,11 +24587,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -24779,11 +24617,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -24798,7 +24632,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -25035,7 +24872,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://gotosocial.org/ns#ReplyRequest\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -25153,11 +24990,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -25183,7 +25020,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -25876,7 +25716,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -25896,7 +25736,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -25914,7 +25754,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"QuoteAuthorization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\"}]; return result; } @@ -25935,7 +25775,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -25950,7 +25790,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -25963,7 +25803,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://w3id.org/fep/044f#QuoteAuthorization\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -26081,11 +25921,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -26126,11 +25966,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -26160,11 +25996,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -26179,7 +26011,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -26416,7 +26251,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://w3id.org/fep/044f#QuoteRequest\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -26534,11 +26369,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -26564,7 +26399,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -26869,7 +26707,7 @@ get endpoints(): (URL)[] { array = []; for (const v of this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -26882,7 +26720,7 @@ get endpoints(): (URL)[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/did#Service\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -26989,11 +26827,11 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -27012,7 +26850,7 @@ get endpoints(): (URL)[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint: (URL)[] = []; @@ -27028,22 +26866,7 @@ get endpoints(): (URL)[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(decoded); } @@ -27051,7 +26874,10 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -27238,7 +27064,7 @@ endpoints?: (URL)[];} >; values[\\"@type\\"] = [\\"https://w3id.org/fep/9091#Export\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -27345,11 +27171,11 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -27375,7 +27201,10 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -28000,7 +27829,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | array = []; for (const v of this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -28066,7 +27895,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } values[\\"@type\\"] = [\\"https://w3id.org/security#DataIntegrityProof\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -28173,11 +28002,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -28192,7 +28021,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: (\\"eddsa-jcs-2022\\")[] = []; @@ -28231,11 +28060,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -28308,7 +28133,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -28964,7 +28792,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi compactItems = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -29014,7 +28842,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } result[\\"type\\"] = \\"CryptographicKey\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://w3id.org/security/v1\\"; return result; } @@ -29025,7 +28853,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi array = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -29053,7 +28881,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } values[\\"@type\\"] = [\\"https://w3id.org/security#Key\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -29160,11 +28988,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -29179,7 +29007,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); @@ -29200,11 +29028,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -29257,7 +29081,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -29861,7 +29688,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; compactItems = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -29911,7 +29738,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } result[\\"type\\"] = \\"Multikey\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://w3id.org/security/multikey/v1\\"; return result; } @@ -29922,7 +29749,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; array = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -29953,7 +29780,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } values[\\"@type\\"] = [\\"https://w3id.org/security#Multikey\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -30060,11 +29887,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -30079,7 +29906,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); @@ -30100,11 +29927,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -30157,7 +29980,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -30523,7 +30349,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Agreement\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"},\\"Agreement\\":\\"vf:Agreement\\",\\"Commitment\\":\\"vf:Commitment\\",\\"stipulates\\":\\"vf:stipulates\\",\\"stipulatesReciprocal\\":\\"vf:stipulatesReciprocal\\",\\"satisfies\\":{\\"@id\\":\\"vf:satisfies\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -30572,7 +30398,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Agreement\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -30690,11 +30516,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -30762,7 +30588,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -31099,7 +30928,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} compactItems = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -31133,7 +30962,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } result[\\"type\\"] = \\"Commitment\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"Commitment\\":\\"vf:Commitment\\",\\"satisfies\\":{\\"@id\\":\\"vf:satisfies\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -31144,7 +30973,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} array = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -31172,7 +31001,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Commitment\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -31279,11 +31108,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -31298,7 +31127,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies: (URL)[] = []; @@ -31314,22 +31143,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.push(decoded); } @@ -31358,7 +31172,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -31842,7 +31659,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur compactItems = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -31916,7 +31733,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } result[\\"type\\"] = \\"Intent\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"Intent\\":\\"vf:Intent\\",\\"action\\":\\"vf:action\\",\\"resourceConformsTo\\":{\\"@id\\":\\"vf:resourceConformsTo\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"availableQuantity\\":\\"vf:availableQuantity\\",\\"minimumQuantity\\":\\"vf:minimumQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -31942,7 +31759,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur array = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -32000,7 +31817,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Intent\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -32107,11 +31924,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -32126,7 +31943,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action: (string)[] = []; @@ -32160,22 +31977,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.push(decoded); } @@ -32246,7 +32048,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -32785,7 +32590,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Proposal\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"},\\"Proposal\\":\\"vf:Proposal\\",\\"Intent\\":\\"vf:Intent\\",\\"purpose\\":\\"vf:purpose\\",\\"unitBased\\":\\"vf:unitBased\\",\\"publishes\\":\\"vf:publishes\\",\\"reciprocal\\":\\"vf:reciprocal\\",\\"action\\":\\"vf:action\\",\\"resourceConformsTo\\":{\\"@id\\":\\"vf:resourceConformsTo\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"availableQuantity\\":\\"vf:availableQuantity\\",\\"minimumQuantity\\":\\"vf:minimumQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -32864,7 +32669,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Proposal\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -32982,11 +32787,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -33090,7 +32895,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -33360,7 +33168,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Accept\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -33478,11 +33286,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -33512,7 +33320,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -33703,7 +33514,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Add\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -33821,11 +33632,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -33851,7 +33662,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -34041,7 +33855,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Announce\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -34159,11 +33973,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -34189,7 +34003,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -38952,7 +38769,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -38972,7 +38789,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39008,7 +38825,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39032,7 +38849,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39056,7 +38873,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39076,7 +38893,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39096,7 +38913,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39116,7 +38933,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39136,7 +38953,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39156,7 +38973,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39260,7 +39077,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39296,7 +39113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39332,7 +39149,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39382,7 +39199,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Application\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -39421,7 +39238,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39436,7 +39253,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39466,7 +39283,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39481,7 +39298,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39496,7 +39313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39511,7 +39328,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39526,7 +39343,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39541,7 +39358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39556,7 +39373,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39571,7 +39388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39661,7 +39478,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39676,7 +39493,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39691,7 +39508,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39734,7 +39551,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Application\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -39862,11 +39679,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -39931,11 +39748,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -39965,11 +39778,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40017,11 +39826,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40059,11 +39864,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40101,11 +39902,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40135,11 +39932,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40169,11 +39962,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40203,11 +39992,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40237,11 +40022,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40271,11 +40052,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40398,11 +40175,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40452,11 +40225,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40506,11 +40275,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40561,7 +40326,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -41223,7 +40991,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -41341,11 +41109,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -41383,7 +41151,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -41573,7 +41344,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Arrive\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -41691,11 +41462,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -41721,7 +41492,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -42459,7 +42233,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -42479,7 +42253,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -42505,7 +42279,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -42523,7 +42297,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Article\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -42544,7 +42318,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -42559,7 +42333,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { \\"@value\\": v.href } + { \\"@value\\": formatIri(v) } ); array.push(element);; } @@ -42578,7 +42352,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -42591,7 +42365,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Article\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -42709,11 +42483,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -42754,11 +42528,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -42791,7 +42561,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v[\\"@value\\"]); + const decoded = parseIri(v[\\"@value\\"]); if (typeof decoded === \\"undefined\\") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -42814,11 +42584,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -42833,7 +42599,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -43182,7 +42951,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Document\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -43237,7 +43006,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Document\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -43355,11 +43124,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -43437,7 +43206,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -43650,7 +43422,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Audio\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -43669,7 +43441,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Audio\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -43787,11 +43559,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -43817,7 +43589,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -44006,7 +43781,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Ignore\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -44124,11 +43899,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -44158,7 +43933,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -44349,7 +44127,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Block\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -44467,11 +44245,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -44497,7 +44275,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -47824,7 +47605,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47844,7 +47625,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47864,7 +47645,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47884,7 +47665,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47908,7 +47689,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47928,7 +47709,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47948,7 +47729,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47968,7 +47749,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47988,7 +47769,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48008,7 +47789,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48028,7 +47809,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48048,7 +47829,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48066,7 +47847,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Collection\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"sensitive\\":\\"as:sensitive\\",\\"votersCount\\":\\"toot:votersCount\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -48105,7 +47886,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48120,7 +47901,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48135,7 +47916,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48150,7 +47931,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -48165,7 +47946,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48180,7 +47961,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48195,7 +47976,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48210,7 +47991,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48225,7 +48006,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48240,7 +48021,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48255,7 +48036,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48270,7 +48051,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48283,7 +48064,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Collection\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -48401,11 +48182,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -48476,11 +48257,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3UyUdxnyn6cDn53QKrh4MBiearma_current.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3UyUdxnyn6cDn53QKrh4MBiearma_current.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48510,11 +48287,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _J52RqweMe6hhv7RnLJMC8BExTE5_first.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _J52RqweMe6hhv7RnLJMC8BExTE5_first.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48544,11 +48317,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48578,11 +48347,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48622,11 +48387,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48656,11 +48417,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48690,11 +48447,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48724,11 +48477,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48758,11 +48507,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48792,11 +48537,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48826,11 +48567,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48860,11 +48597,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48879,7 +48612,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -50084,7 +49820,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50104,7 +49840,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50124,7 +49860,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50142,7 +49878,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"CollectionPage\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"sensitive\\":\\"as:sensitive\\",\\"votersCount\\":\\"toot:votersCount\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -50163,7 +49899,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50178,7 +49914,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50193,7 +49929,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50206,7 +49942,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#CollectionPage\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -50324,11 +50060,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -50373,11 +50109,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -50407,11 +50139,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -50441,11 +50169,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -50460,7 +50184,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -50707,7 +50434,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Create\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -50825,11 +50552,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -50855,7 +50582,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -51044,7 +50774,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Delete\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -51162,11 +50892,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -51192,7 +50922,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -51379,7 +51112,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Dislike\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -51497,11 +51230,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -51527,7 +51260,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -52001,7 +51737,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52017,7 +51753,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52033,7 +51769,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52049,7 +51785,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52065,7 +51801,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52081,7 +51817,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52095,7 +51831,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; return result; } @@ -52106,7 +51842,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52121,7 +51857,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52136,7 +51872,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52151,7 +51887,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52166,7 +51902,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52181,7 +51917,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52194,7 +51930,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -52301,11 +52037,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -52320,7 +52056,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl: (URL)[] = []; @@ -52336,22 +52072,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(decoded); } @@ -52369,22 +52090,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(decoded); } @@ -52402,22 +52108,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(decoded); } @@ -52435,22 +52126,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(decoded); } @@ -52468,22 +52144,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(decoded); } @@ -52501,22 +52162,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(decoded); } @@ -52524,7 +52170,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -52832,7 +52481,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Event\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -52851,7 +52500,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Event\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -52969,11 +52618,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -52999,7 +52648,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -53189,7 +52841,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Flag\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -53307,11 +52959,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -53337,7 +52989,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -53528,7 +53183,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Follow\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -53646,11 +53301,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -53676,7 +53331,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -58439,7 +58097,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58459,7 +58117,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58495,7 +58153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58519,7 +58177,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58543,7 +58201,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58563,7 +58221,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58583,7 +58241,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58603,7 +58261,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58623,7 +58281,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58643,7 +58301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58747,7 +58405,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58783,7 +58441,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58819,7 +58477,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58869,7 +58527,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Group\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -58908,7 +58566,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58923,7 +58581,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58953,7 +58611,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -58968,7 +58626,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -58983,7 +58641,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58998,7 +58656,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59013,7 +58671,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59028,7 +58686,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59043,7 +58701,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59058,7 +58716,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59148,7 +58806,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -59163,7 +58821,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -59178,7 +58836,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59221,7 +58879,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Group\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -59349,11 +59007,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -59418,11 +59076,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59452,11 +59106,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59504,11 +59154,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59546,11 +59192,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59588,11 +59230,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59622,11 +59260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59656,11 +59290,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59690,11 +59320,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59724,11 +59350,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59758,11 +59380,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59885,11 +59503,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59939,11 +59553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59993,11 +59603,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -60048,7 +59654,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -61425,7 +61034,7 @@ get names(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -61540,7 +61149,7 @@ get names(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const item = ( - v instanceof URL ? v.href : v instanceof Link ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Link ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -61562,7 +61171,7 @@ get names(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Link\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; return result; } @@ -61573,7 +61182,7 @@ get names(): ((string | LanguageString))[] { array = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -61687,7 +61296,7 @@ get names(): ((string | LanguageString))[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -61700,7 +61309,7 @@ get names(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Link\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -61812,11 +61421,11 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -61839,7 +61448,7 @@ get names(): ((string | LanguageString))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; @@ -61855,22 +61464,7 @@ get names(): ((string | LanguageString))[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(decoded); } @@ -62007,11 +61601,7 @@ get names(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -62036,7 +61626,10 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -62373,7 +61966,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let compactItems: unknown[]; result[\\"type\\"] = \\"Hashtag\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"Hashtag\\":\\"as:Hashtag\\"}]; return result; } @@ -62392,7 +61985,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Hashtag\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -62499,11 +62092,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -62529,7 +62122,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -62702,7 +62298,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Image\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -62721,7 +62317,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Image\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -62839,11 +62435,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -62869,7 +62465,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -63059,7 +62658,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Offer\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -63177,11 +62776,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -63211,7 +62810,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -63400,7 +63002,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Invite\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -63518,11 +63120,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -63548,7 +63150,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -63737,7 +63342,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Join\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -63855,11 +63460,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -63885,7 +63490,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -64074,7 +63682,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Leave\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -64192,11 +63800,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -64222,7 +63830,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -64411,7 +64022,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Like\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -64529,11 +64140,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -64559,7 +64170,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -64746,7 +64360,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Listen\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -64864,11 +64478,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -64894,7 +64508,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -65039,7 +64656,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let compactItems: unknown[]; result[\\"type\\"] = \\"Mention\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; return result; } @@ -65058,7 +64675,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Mention\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -65165,11 +64782,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -65195,7 +64812,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -65385,7 +65005,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Move\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -65503,11 +65123,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -65533,7 +65153,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -66273,7 +65896,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -66293,7 +65916,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -66319,7 +65942,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -66337,7 +65960,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Note\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -66358,7 +65981,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -66373,7 +65996,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { \\"@value\\": v.href } + { \\"@value\\": formatIri(v) } ); array.push(element);; } @@ -66392,7 +66015,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -66405,7 +66028,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Note\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -66523,11 +66146,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -66568,11 +66191,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -66605,7 +66224,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v[\\"@value\\"]); + const decoded = parseIri(v[\\"@value\\"]); if (typeof decoded === \\"undefined\\") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -66628,11 +66247,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -66647,7 +66262,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -67164,7 +66782,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -67183,7 +66801,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"OrderedCollection\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"sensitive\\":\\"as:sensitive\\",\\"votersCount\\":\\"toot:votersCount\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -67204,7 +66822,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -67217,7 +66835,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -67335,11 +66953,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -67380,11 +66998,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -67409,7 +67023,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -67931,7 +67548,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -67966,7 +67583,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"OrderedCollectionPage\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"sensitive\\":\\"as:sensitive\\",\\"votersCount\\":\\"toot:votersCount\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -67987,7 +67604,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -68018,7 +67635,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -68136,11 +67753,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -68181,11 +67798,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -68228,7 +67841,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -73033,7 +72649,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73053,7 +72669,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73089,7 +72705,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73113,7 +72729,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73137,7 +72753,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73157,7 +72773,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73177,7 +72793,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73197,7 +72813,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73217,7 +72833,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73237,7 +72853,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73341,7 +72957,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73377,7 +72993,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73413,7 +73029,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73463,7 +73079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Organization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -73502,7 +73118,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73517,7 +73133,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73547,7 +73163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73562,7 +73178,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73577,7 +73193,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73592,7 +73208,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73607,7 +73223,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73622,7 +73238,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73637,7 +73253,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73652,7 +73268,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73742,7 +73358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73757,7 +73373,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73772,7 +73388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73815,7 +73431,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Organization\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -73943,11 +73559,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -74012,11 +73628,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74046,11 +73658,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74098,11 +73706,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74140,11 +73744,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74182,11 +73782,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74216,11 +73812,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74250,11 +73842,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74284,11 +73872,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74318,11 +73902,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74352,11 +73932,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74479,11 +74055,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74533,11 +74105,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74587,11 +74155,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74642,7 +74206,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -75287,7 +74854,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Page\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -75306,7 +74873,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Page\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -75424,11 +74991,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -75454,7 +75021,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -80217,7 +79787,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80237,7 +79807,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80273,7 +79843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80297,7 +79867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80321,7 +79891,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80341,7 +79911,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80361,7 +79931,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80381,7 +79951,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80401,7 +79971,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80421,7 +79991,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80525,7 +80095,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80561,7 +80131,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80597,7 +80167,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80647,7 +80217,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Person\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -80686,7 +80256,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80701,7 +80271,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80731,7 +80301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80746,7 +80316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80761,7 +80331,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80776,7 +80346,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80791,7 +80361,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80806,7 +80376,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80821,7 +80391,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80836,7 +80406,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80926,7 +80496,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80941,7 +80511,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80956,7 +80526,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80999,7 +80569,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Person\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -81127,11 +80697,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -81196,11 +80766,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81230,11 +80796,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81282,11 +80844,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81324,11 +80882,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81366,11 +80920,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81400,11 +80950,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81434,11 +80980,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81468,11 +81010,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81502,11 +81040,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81536,11 +81070,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81663,11 +81193,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81717,11 +81243,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81771,11 +81293,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81826,7 +81344,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -82808,7 +82329,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { const item = ( - v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? v : v.href + v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? v : formatIri(v) ); compactItems.push(item); } @@ -82822,7 +82343,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Place\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -82933,7 +82454,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { const element = ( - v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? { \\"@value\\": v } : { \\"@id\\": v.href } + v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? { \\"@value\\": v } : { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -82946,7 +82467,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Place\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -83064,11 +82585,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -83198,22 +82719,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu typeof v === \\"object\\" && \\"@value\\" in v && (v[\\"@value\\"] == \\"cm\\" || v[\\"@value\\"] == \\"feet\\" || v[\\"@value\\"] == \\"inches\\" || v[\\"@value\\"] == \\"km\\" || v[\\"@value\\"] == \\"m\\" || v[\\"@value\\"] == \\"miles\\") ? v[\\"@value\\"] : v != null && typeof v === \\"object\\" && \\"@id\\" in v && typeof v[\\"@id\\"] === \\"string\\" - && v[\\"@id\\"] !== \\"\\" ? v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl) : undefined + && v[\\"@id\\"] !== \\"\\" ? parseIri(v[\\"@id\\"], options.baseUrl) : undefined ; if (typeof decoded === \\"undefined\\") continue; _oKrwxU4V8wiKhMW1QEYQibcJh8c_units.push(decoded); @@ -83223,7 +82729,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -83779,7 +83288,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -83797,7 +83306,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Profile\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -83818,7 +83327,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -83831,7 +83340,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Profile\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -83949,11 +83458,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -83994,11 +83503,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -84013,7 +83518,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -85421,7 +84929,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85436,7 +84944,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85487,7 +84995,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85502,7 +85010,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { \\"@value\\": v.href } + { \\"@value\\": formatIri(v) } ); array.push(element);; } @@ -85521,7 +85029,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85534,7 +85042,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Question\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -85652,11 +85160,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -85697,11 +85205,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -85731,11 +85235,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -85814,11 +85314,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -85851,7 +85347,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ) { if (v == null) continue; - const decoded = new URL(v[\\"@value\\"]); + const decoded = parseIri(v[\\"@value\\"]); if (typeof decoded === \\"undefined\\") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -85874,11 +85370,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -85893,7 +85385,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -86225,7 +85720,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Read\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -86343,11 +85838,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -86373,7 +85868,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -86562,7 +86060,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Reject\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -86680,11 +86178,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -86714,7 +86212,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -87994,7 +87495,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88014,7 +87515,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88034,7 +87535,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88052,7 +87553,7 @@ relationships?: (Object | URL)[];} } result[\\"type\\"] = \\"Relationship\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -88073,7 +87574,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88088,7 +87589,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88103,7 +87604,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88116,7 +87617,7 @@ relationships?: (Object | URL)[];} } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Relationship\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -88234,11 +87735,11 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -88279,11 +87780,7 @@ relationships?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -88313,11 +87810,7 @@ relationships?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -88347,11 +87840,7 @@ relationships?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -88366,7 +87855,10 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -88627,7 +88119,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Remove\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -88745,11 +88237,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -88775,7 +88267,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -93538,7 +93033,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93558,7 +93053,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93594,7 +93089,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93618,7 +93113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93642,7 +93137,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93662,7 +93157,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93682,7 +93177,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93702,7 +93197,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93722,7 +93217,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93742,7 +93237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93846,7 +93341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93882,7 +93377,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93918,7 +93413,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93968,7 +93463,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Service\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -94007,7 +93502,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94022,7 +93517,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94052,7 +93547,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94067,7 +93562,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94082,7 +93577,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94097,7 +93592,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94112,7 +93607,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94127,7 +93622,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94142,7 +93637,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94157,7 +93652,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94247,7 +93742,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94262,7 +93757,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94277,7 +93772,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94320,7 +93815,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Service\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -94448,11 +93943,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -94517,11 +94012,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94551,11 +94042,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94603,11 +94090,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94645,11 +94128,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94687,11 +94166,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94721,11 +94196,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94755,11 +94226,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94789,11 +94256,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94823,11 +94286,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94857,11 +94316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94984,11 +94439,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -95038,11 +94489,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -95092,11 +94539,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -95147,7 +94590,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -95991,7 +95437,7 @@ get contents(): ((string | LanguageString))[] { } - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; return result; } @@ -96033,7 +95479,7 @@ get contents(): ((string | LanguageString))[] { } - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -96145,11 +95591,11 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -96164,7 +95610,7 @@ get contents(): ((string | LanguageString))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; @@ -96212,7 +95658,10 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -96462,7 +95911,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -96580,11 +96029,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -96610,7 +96059,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -96799,7 +96251,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#TentativeReject\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -96917,11 +96369,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -96947,7 +96399,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -97295,7 +96750,7 @@ get formerTypes(): (\$EntityType)[] { } result[\\"type\\"] = \\"Tombstone\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -97347,7 +96802,7 @@ get formerTypes(): (\$EntityType)[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Tombstone\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -97470,11 +96925,11 @@ get formerTypes(): (\$EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -97553,7 +97008,10 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -97790,7 +97248,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Travel\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -97908,11 +97366,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -97938,7 +97396,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -98132,7 +97593,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Undo\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -98250,11 +97711,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -98280,7 +97741,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -98472,7 +97936,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Update\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -98590,11 +98054,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -98620,7 +98084,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -98793,7 +98260,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Video\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -98812,7 +98279,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Video\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -98930,11 +98397,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -98960,7 +98427,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -99148,7 +98618,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#View\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -99266,11 +98736,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -99296,7 +98766,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 5fe5c81bc..aeb820fea 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -6,17 +6,20 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from \\"@opentelemetry/api\\"; import { canParseDecimal, + canParseIri, decodeMultibase, type Decimal, type DocumentLoader, encodeMultibase, exportMultibaseKey, exportSpki, + formatIri, getDocumentLoader, importMultibaseKey, importPem, isDecimal, LanguageString, + parseIri, parseDecimal, type RemoteDocument } from \\"@fedify/vocab-runtime\\"; @@ -9116,7 +9119,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9144,7 +9147,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9180,7 +9183,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9219,7 +9222,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9278,7 +9281,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9302,7 +9305,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9322,7 +9325,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9342,7 +9345,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9366,7 +9369,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9390,7 +9393,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const item = ( - v instanceof URL ? v.href : v instanceof Link ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Link ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9430,7 +9433,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9450,7 +9453,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9470,7 +9473,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9490,7 +9493,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9545,7 +9548,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9585,7 +9588,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9605,7 +9608,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9625,7 +9628,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9645,7 +9648,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9665,7 +9668,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9753,7 +9756,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9793,7 +9796,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -9809,7 +9812,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9829,7 +9832,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9849,7 +9852,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9867,7 +9870,7 @@ get urls(): ((URL | Link))[] { } result[\\"type\\"] = \\"Object\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -9878,7 +9881,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9893,7 +9896,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9908,7 +9911,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -9941,7 +9944,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9992,7 +9995,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10007,7 +10010,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10022,7 +10025,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10037,7 +10040,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10052,7 +10055,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10067,7 +10070,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10100,7 +10103,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10115,7 +10118,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10130,7 +10133,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10145,7 +10148,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10196,7 +10199,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10229,7 +10232,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10244,7 +10247,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10259,7 +10262,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10274,7 +10277,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10289,7 +10292,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10367,7 +10370,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push({ \\"@graph\\": element });; } @@ -10397,7 +10400,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -10412,7 +10415,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10427,7 +10430,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10442,7 +10445,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10455,7 +10458,7 @@ get urls(): ((URL | Link))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Object\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -10598,11 +10601,11 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -10873,7 +10876,7 @@ get urls(): ((URL | Link))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); @@ -10894,11 +10897,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _49BipA5dq9eoH8LX8xdsVumveTca_attachment.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _49BipA5dq9eoH8LX8xdsVumveTca_attachment.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -10942,11 +10941,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -10996,11 +10991,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11054,11 +11045,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3mhZzGXSpQ431mBSz2kvych22v4e_context.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3mhZzGXSpQ431mBSz2kvych22v4e_context.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11144,11 +11131,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _86xFhmgBapoMvYqjbjRuDPayTrS_generator.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _86xFhmgBapoMvYqjbjRuDPayTrS_generator.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11210,11 +11193,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11266,11 +11245,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11300,11 +11275,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11344,11 +11315,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _31k5MUZJsnsPNg8dQQJieWaXTFnR_location.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _31k5MUZJsnsPNg8dQQJieWaXTFnR_location.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11388,11 +11355,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11454,11 +11417,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _7UpwM3JWcXhADcscukEehBorf6k_replies.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _7UpwM3JWcXhADcscukEehBorf6k_replies.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11488,11 +11447,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11522,11 +11477,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11556,11 +11507,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11636,11 +11583,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _5chuqj6s95p5gg2sk1HntGfarRf_tag.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _5chuqj6s95p5gg2sk1HntGfarRf_tag.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11700,22 +11643,7 @@ get urls(): ((URL | Link))[] { const decoded = v != null && typeof v === \\"object\\" && \\"@id\\" in v && typeof v[\\"@id\\"] === \\"string\\" - && v[\\"@id\\"] !== \\"\\" ? v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl) : typeof v === \\"object\\" && \\"@type\\" in v + && v[\\"@id\\"] !== \\"\\" ? parseIri(v[\\"@id\\"], options.baseUrl) : typeof v === \\"object\\" && \\"@type\\" in v && Array.isArray(v[\\"@type\\"])&& [\\"https://www.w3.org/ns/activitystreams#Link\\",\\"https://www.w3.org/ns/activitystreams#Hashtag\\",\\"https://www.w3.org/ns/activitystreams#Mention\\"].some( t => v[\\"@type\\"].includes(t)) ? await Link.fromJsonLd( v, @@ -11745,11 +11673,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11779,11 +11703,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11813,11 +11733,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11847,11 +11763,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -11956,11 +11868,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -12006,22 +11914,7 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.push(decoded); } @@ -12044,11 +11937,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -12078,11 +11967,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -12112,11 +11997,7 @@ get urls(): ((URL | Link))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -12131,7 +12012,10 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -13163,7 +13047,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Emoji\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\"}]; return result; } @@ -13182,7 +13066,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"http://joinmastodon.org/ns#Emoji\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -13300,11 +13184,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -13330,7 +13214,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -14073,7 +13960,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -14093,7 +13980,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -14119,7 +14006,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -14137,7 +14024,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"ChatMessage\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -14158,7 +14045,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -14173,7 +14060,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { \\"@value\\": v.href } + { \\"@value\\": formatIri(v) } ); array.push(element);; } @@ -14192,7 +14079,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -14205,7 +14092,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"http://litepub.social/ns#ChatMessage\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -14323,11 +14210,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -14368,11 +14255,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -14405,7 +14288,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v[\\"@value\\"]); + const decoded = parseIri(v[\\"@value\\"]); if (typeof decoded === \\"undefined\\") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -14428,11 +14311,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -14447,7 +14326,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -17263,7 +17145,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -17278,7 +17160,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17293,7 +17175,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17308,7 +17190,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17323,7 +17205,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17338,7 +17220,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17351,7 +17233,7 @@ instruments?: (Object | URL)[];} } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Activity\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -17469,11 +17351,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -17650,11 +17532,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17704,11 +17582,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17738,11 +17612,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17772,11 +17642,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17806,11 +17672,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _25zu2s3VxVujgEKqrDycjE284XQR_origin.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _25zu2s3VxVujgEKqrDycjE284XQR_origin.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17840,11 +17702,7 @@ instruments?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -17859,7 +17717,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -18203,7 +18064,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"http://litepub.social/ns#EmojiReact\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -18321,11 +18182,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -18351,7 +18212,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -18672,7 +18536,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } result[\\"type\\"] = \\"PropertyValue\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\"}]; return result; } @@ -18717,7 +18581,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } values[\\"@type\\"] = [\\"http://schema.org#PropertyValue\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -18834,11 +18698,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -18853,7 +18717,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; @@ -18907,7 +18771,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -19281,7 +19148,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } result[\\"type\\"] = \\"om2:Measure\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -19323,7 +19190,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } values[\\"@type\\"] = [\\"http://www.ontology-of-units-of-measure.org/resource/om-2/Measure\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -19430,11 +19297,11 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -19449,7 +19316,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _27fgyFbosTtMAhuepJH8K3ZGURT6: (string)[] = []; @@ -19491,7 +19358,10 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -20241,7 +20111,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -20261,7 +20131,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -20279,7 +20149,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"AnnounceAuthorization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -20300,7 +20170,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -20315,7 +20185,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -20328,7 +20198,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://gotosocial.org/ns#AnnounceAuthorization\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -20446,11 +20316,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -20491,11 +20361,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -20525,11 +20391,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -20544,7 +20406,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -20782,7 +20647,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://gotosocial.org/ns#AnnounceRequest\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -20900,11 +20765,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -20930,7 +20795,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -21374,7 +21242,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -21501,11 +21369,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -21520,7 +21388,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike: (InteractionRule)[] = []; @@ -21610,7 +21478,10 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -22124,7 +21995,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -22139,7 +22010,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -22152,7 +22023,7 @@ get manualApprovals(): (URL)[] { } - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -22259,11 +22130,11 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -22278,7 +22149,7 @@ get manualApprovals(): (URL)[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval: (URL)[] = []; @@ -22294,22 +22165,7 @@ get manualApprovals(): (URL)[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.push(decoded); } @@ -22327,22 +22183,7 @@ get manualApprovals(): (URL)[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.push(decoded); } @@ -22350,7 +22191,10 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -23111,7 +22955,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -23131,7 +22975,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -23149,7 +22993,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"LikeAuthorization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -23170,7 +23014,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -23185,7 +23029,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -23198,7 +23042,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://gotosocial.org/ns#LikeApproval\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -23316,11 +23160,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -23361,11 +23205,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -23395,11 +23235,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -23414,7 +23250,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -23651,7 +23490,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://gotosocial.org/ns#LikeRequest\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -23769,11 +23608,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -23799,7 +23638,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -24493,7 +24335,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -24513,7 +24355,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -24531,7 +24373,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"ReplyAuthorization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -24552,7 +24394,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -24567,7 +24409,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -24580,7 +24422,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://gotosocial.org/ns#ReplyAuthorization\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -24698,11 +24540,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -24743,11 +24585,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -24777,11 +24615,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -24796,7 +24630,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -25033,7 +24870,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://gotosocial.org/ns#ReplyRequest\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -25151,11 +24988,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -25181,7 +25018,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -25874,7 +25714,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -25894,7 +25734,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -25912,7 +25752,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"QuoteAuthorization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\"}]; return result; } @@ -25933,7 +25773,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -25948,7 +25788,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -25961,7 +25801,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://w3id.org/fep/044f#QuoteAuthorization\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -26079,11 +25919,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -26124,11 +25964,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -26158,11 +25994,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -26177,7 +26009,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -26414,7 +26249,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://w3id.org/fep/044f#QuoteRequest\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -26532,11 +26367,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -26562,7 +26397,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -26867,7 +26705,7 @@ get endpoints(): (URL)[] { array = []; for (const v of this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -26880,7 +26718,7 @@ get endpoints(): (URL)[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/did#Service\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -26987,11 +26825,11 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -27010,7 +26848,7 @@ get endpoints(): (URL)[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint: (URL)[] = []; @@ -27026,22 +26864,7 @@ get endpoints(): (URL)[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(decoded); } @@ -27049,7 +26872,10 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -27236,7 +27062,7 @@ endpoints?: (URL)[];} >; values[\\"@type\\"] = [\\"https://w3id.org/fep/9091#Export\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -27343,11 +27169,11 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -27373,7 +27199,10 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -27998,7 +27827,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | array = []; for (const v of this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -28064,7 +27893,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } values[\\"@type\\"] = [\\"https://w3id.org/security#DataIntegrityProof\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -28171,11 +28000,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -28190,7 +28019,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: (\\"eddsa-jcs-2022\\")[] = []; @@ -28229,11 +28058,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -28306,7 +28131,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -28962,7 +28790,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi compactItems = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -29012,7 +28840,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } result[\\"type\\"] = \\"CryptographicKey\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://w3id.org/security/v1\\"; return result; } @@ -29023,7 +28851,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi array = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -29051,7 +28879,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } values[\\"@type\\"] = [\\"https://w3id.org/security#Key\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -29158,11 +28986,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -29177,7 +29005,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); @@ -29198,11 +29026,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -29255,7 +29079,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -29859,7 +29686,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; compactItems = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -29909,7 +29736,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } result[\\"type\\"] = \\"Multikey\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://w3id.org/security/multikey/v1\\"; return result; } @@ -29920,7 +29747,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; array = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -29951,7 +29778,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } values[\\"@type\\"] = [\\"https://w3id.org/security#Multikey\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -30058,11 +29885,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -30077,7 +29904,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); @@ -30098,11 +29925,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -30155,7 +29978,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -30521,7 +30347,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Agreement\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"},\\"Agreement\\":\\"vf:Agreement\\",\\"Commitment\\":\\"vf:Commitment\\",\\"stipulates\\":\\"vf:stipulates\\",\\"stipulatesReciprocal\\":\\"vf:stipulatesReciprocal\\",\\"satisfies\\":{\\"@id\\":\\"vf:satisfies\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -30570,7 +30396,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Agreement\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -30688,11 +30514,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -30760,7 +30586,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -31097,7 +30926,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} compactItems = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -31131,7 +30960,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } result[\\"type\\"] = \\"Commitment\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"Commitment\\":\\"vf:Commitment\\",\\"satisfies\\":{\\"@id\\":\\"vf:satisfies\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -31142,7 +30971,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} array = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -31170,7 +30999,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Commitment\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -31277,11 +31106,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -31296,7 +31125,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies: (URL)[] = []; @@ -31312,22 +31141,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.push(decoded); } @@ -31356,7 +31170,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -31840,7 +31657,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur compactItems = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -31914,7 +31731,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } result[\\"type\\"] = \\"Intent\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"Intent\\":\\"vf:Intent\\",\\"action\\":\\"vf:action\\",\\"resourceConformsTo\\":{\\"@id\\":\\"vf:resourceConformsTo\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"availableQuantity\\":\\"vf:availableQuantity\\",\\"minimumQuantity\\":\\"vf:minimumQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -31940,7 +31757,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur array = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -31998,7 +31815,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Intent\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -32105,11 +31922,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -32124,7 +31941,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action: (string)[] = []; @@ -32158,22 +31975,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.push(decoded); } @@ -32244,7 +32046,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -32783,7 +32588,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Proposal\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"vf\\":\\"https://w3id.org/valueflows/ont/vf#\\",\\"om2\\":\\"http://www.ontology-of-units-of-measure.org/resource/om-2/\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"},\\"Proposal\\":\\"vf:Proposal\\",\\"Intent\\":\\"vf:Intent\\",\\"purpose\\":\\"vf:purpose\\",\\"unitBased\\":\\"vf:unitBased\\",\\"publishes\\":\\"vf:publishes\\",\\"reciprocal\\":\\"vf:reciprocal\\",\\"action\\":\\"vf:action\\",\\"resourceConformsTo\\":{\\"@id\\":\\"vf:resourceConformsTo\\",\\"@type\\":\\"@id\\"},\\"resourceQuantity\\":\\"vf:resourceQuantity\\",\\"availableQuantity\\":\\"vf:availableQuantity\\",\\"minimumQuantity\\":\\"vf:minimumQuantity\\",\\"hasUnit\\":\\"om2:hasUnit\\",\\"hasNumericalValue\\":\\"om2:hasNumericalValue\\"}]; return result; } @@ -32862,7 +32667,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://w3id.org/valueflows/ont/vf#Proposal\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -32980,11 +32785,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -33088,7 +32893,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -33358,7 +33166,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Accept\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -33476,11 +33284,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -33510,7 +33318,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -33701,7 +33512,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Add\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -33819,11 +33630,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -33849,7 +33660,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -34039,7 +33853,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Announce\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -34157,11 +33971,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -34187,7 +34001,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -38950,7 +38767,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -38970,7 +38787,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39006,7 +38823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39030,7 +38847,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39054,7 +38871,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39074,7 +38891,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39094,7 +38911,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39114,7 +38931,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39134,7 +38951,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39154,7 +38971,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39258,7 +39075,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39294,7 +39111,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39330,7 +39147,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39380,7 +39197,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Application\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -39419,7 +39236,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39434,7 +39251,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39464,7 +39281,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39479,7 +39296,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39494,7 +39311,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39509,7 +39326,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39524,7 +39341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39539,7 +39356,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39554,7 +39371,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39569,7 +39386,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39659,7 +39476,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39674,7 +39491,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39689,7 +39506,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39732,7 +39549,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Application\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -39860,11 +39677,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -39929,11 +39746,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -39963,11 +39776,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40015,11 +39824,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40057,11 +39862,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40099,11 +39900,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40133,11 +39930,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40167,11 +39960,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40201,11 +39990,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40235,11 +40020,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40269,11 +40050,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40396,11 +40173,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40450,11 +40223,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40504,11 +40273,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -40559,7 +40324,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -41221,7 +40989,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#IntransitiveActivity\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -41339,11 +41107,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -41381,7 +41149,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -41571,7 +41342,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Arrive\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -41689,11 +41460,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -41719,7 +41490,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -42457,7 +42231,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -42477,7 +42251,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -42503,7 +42277,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -42521,7 +42295,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Article\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -42542,7 +42316,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -42557,7 +42331,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { \\"@value\\": v.href } + { \\"@value\\": formatIri(v) } ); array.push(element);; } @@ -42576,7 +42350,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -42589,7 +42363,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Article\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -42707,11 +42481,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -42752,11 +42526,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -42789,7 +42559,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v[\\"@value\\"]); + const decoded = parseIri(v[\\"@value\\"]); if (typeof decoded === \\"undefined\\") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -42812,11 +42582,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -42831,7 +42597,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -43180,7 +42949,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Document\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -43235,7 +43004,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Document\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -43353,11 +43122,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -43435,7 +43204,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -43648,7 +43420,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Audio\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -43667,7 +43439,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Audio\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -43785,11 +43557,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -43815,7 +43587,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -44004,7 +43779,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Ignore\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -44122,11 +43897,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -44156,7 +43931,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -44347,7 +44125,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Block\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -44465,11 +44243,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -44495,7 +44273,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -47822,7 +47603,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47842,7 +47623,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47862,7 +47643,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47882,7 +47663,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47906,7 +47687,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47926,7 +47707,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47946,7 +47727,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47966,7 +47747,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47986,7 +47767,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48006,7 +47787,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48026,7 +47807,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48046,7 +47827,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48064,7 +47845,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Collection\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"sensitive\\":\\"as:sensitive\\",\\"votersCount\\":\\"toot:votersCount\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -48103,7 +47884,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48118,7 +47899,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48133,7 +47914,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48148,7 +47929,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -48163,7 +47944,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48178,7 +47959,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48193,7 +47974,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48208,7 +47989,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48223,7 +48004,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48238,7 +48019,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48253,7 +48034,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48268,7 +48049,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48281,7 +48062,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Collection\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -48399,11 +48180,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -48474,11 +48255,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3UyUdxnyn6cDn53QKrh4MBiearma_current.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3UyUdxnyn6cDn53QKrh4MBiearma_current.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48508,11 +48285,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _J52RqweMe6hhv7RnLJMC8BExTE5_first.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _J52RqweMe6hhv7RnLJMC8BExTE5_first.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48542,11 +48315,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48576,11 +48345,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48620,11 +48385,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48654,11 +48415,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48688,11 +48445,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48722,11 +48475,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48756,11 +48505,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48790,11 +48535,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48824,11 +48565,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48858,11 +48595,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -48877,7 +48610,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -50082,7 +49818,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50102,7 +49838,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50122,7 +49858,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50140,7 +49876,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"CollectionPage\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"sensitive\\":\\"as:sensitive\\",\\"votersCount\\":\\"toot:votersCount\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -50161,7 +49897,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50176,7 +49912,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50191,7 +49927,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50204,7 +49940,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#CollectionPage\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -50322,11 +50058,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -50371,11 +50107,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -50405,11 +50137,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -50439,11 +50167,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -50458,7 +50182,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -50705,7 +50432,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Create\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -50823,11 +50550,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -50853,7 +50580,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -51042,7 +50772,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Delete\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -51160,11 +50890,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -51190,7 +50920,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -51377,7 +51110,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Dislike\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -51495,11 +51228,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -51525,7 +51258,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -51999,7 +51735,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52015,7 +51751,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52031,7 +51767,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52047,7 +51783,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52063,7 +51799,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52079,7 +51815,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52093,7 +51829,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; return result; } @@ -52104,7 +51840,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52119,7 +51855,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52134,7 +51870,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52149,7 +51885,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52164,7 +51900,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52179,7 +51915,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -52192,7 +51928,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -52299,11 +52035,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -52318,7 +52054,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl: (URL)[] = []; @@ -52334,22 +52070,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(decoded); } @@ -52367,22 +52088,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(decoded); } @@ -52400,22 +52106,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(decoded); } @@ -52433,22 +52124,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(decoded); } @@ -52466,22 +52142,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(decoded); } @@ -52499,22 +52160,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(decoded); } @@ -52522,7 +52168,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -52830,7 +52479,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Event\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -52849,7 +52498,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Event\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -52967,11 +52616,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -52997,7 +52646,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -53187,7 +52839,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Flag\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -53305,11 +52957,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -53335,7 +52987,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -53526,7 +53181,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Follow\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -53644,11 +53299,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -53674,7 +53329,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -58437,7 +58095,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58457,7 +58115,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58493,7 +58151,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58517,7 +58175,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58541,7 +58199,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58561,7 +58219,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58581,7 +58239,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58601,7 +58259,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58621,7 +58279,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58641,7 +58299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58745,7 +58403,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58781,7 +58439,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58817,7 +58475,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58867,7 +58525,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Group\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -58906,7 +58564,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58921,7 +58579,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58951,7 +58609,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -58966,7 +58624,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -58981,7 +58639,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58996,7 +58654,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59011,7 +58669,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59026,7 +58684,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59041,7 +58699,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59056,7 +58714,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59146,7 +58804,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -59161,7 +58819,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -59176,7 +58834,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59219,7 +58877,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Group\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -59347,11 +59005,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -59416,11 +59074,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59450,11 +59104,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59502,11 +59152,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59544,11 +59190,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59586,11 +59228,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59620,11 +59258,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59654,11 +59288,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59688,11 +59318,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59722,11 +59348,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59756,11 +59378,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59883,11 +59501,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59937,11 +59551,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -59991,11 +59601,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -60046,7 +59652,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -61423,7 +61032,7 @@ get names(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -61538,7 +61147,7 @@ get names(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const item = ( - v instanceof URL ? v.href : v instanceof Link ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Link ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -61560,7 +61169,7 @@ get names(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Link\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; return result; } @@ -61571,7 +61180,7 @@ get names(): ((string | LanguageString))[] { array = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { const element = ( - { \\"@id\\": v.href } + { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -61685,7 +61294,7 @@ get names(): ((string | LanguageString))[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -61698,7 +61307,7 @@ get names(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Link\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -61810,11 +61419,11 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -61837,7 +61446,7 @@ get names(): ((string | LanguageString))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; @@ -61853,22 +61462,7 @@ get names(): ((string | LanguageString))[] { ) { if (v == null) continue; - const decoded = v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl); + const decoded = parseIri(v[\\"@id\\"], options.baseUrl); if (typeof decoded === \\"undefined\\") continue; _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(decoded); } @@ -62005,11 +61599,7 @@ get names(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -62034,7 +61624,10 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -62371,7 +61964,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let compactItems: unknown[]; result[\\"type\\"] = \\"Hashtag\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",{\\"Hashtag\\":\\"as:Hashtag\\"}]; return result; } @@ -62390,7 +61983,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Hashtag\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -62497,11 +62090,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -62527,7 +62120,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -62700,7 +62296,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Image\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -62719,7 +62315,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Image\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -62837,11 +62433,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -62867,7 +62463,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -63057,7 +62656,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Offer\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -63175,11 +62774,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -63209,7 +62808,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -63398,7 +63000,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Invite\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -63516,11 +63118,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -63546,7 +63148,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -63735,7 +63340,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Join\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -63853,11 +63458,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -63883,7 +63488,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -64072,7 +63680,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Leave\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -64190,11 +63798,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -64220,7 +63828,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -64409,7 +64020,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Like\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -64527,11 +64138,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -64557,7 +64168,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -64744,7 +64358,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Listen\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -64862,11 +64476,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -64892,7 +64506,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -65037,7 +64654,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let compactItems: unknown[]; result[\\"type\\"] = \\"Mention\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; return result; } @@ -65056,7 +64673,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Mention\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -65163,11 +64780,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -65193,7 +64810,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -65383,7 +65003,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Move\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -65501,11 +65121,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -65531,7 +65151,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -66271,7 +65894,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -66291,7 +65914,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -66317,7 +65940,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -66335,7 +65958,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Note\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"sensitive\\":\\"as:sensitive\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -66356,7 +65979,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -66371,7 +65994,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { \\"@value\\": v.href } + { \\"@value\\": formatIri(v) } ); array.push(element);; } @@ -66390,7 +66013,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -66403,7 +66026,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Note\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -66521,11 +66144,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -66566,11 +66189,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -66603,7 +66222,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v[\\"@value\\"]); + const decoded = parseIri(v[\\"@value\\"]); if (typeof decoded === \\"undefined\\") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -66626,11 +66245,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -66645,7 +66260,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -67162,7 +66780,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -67181,7 +66799,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"OrderedCollection\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"sensitive\\":\\"as:sensitive\\",\\"votersCount\\":\\"toot:votersCount\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -67202,7 +66820,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -67215,7 +66833,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#OrderedCollection\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -67333,11 +66951,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -67378,11 +66996,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -67407,7 +67021,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -67929,7 +67546,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -67964,7 +67581,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"OrderedCollectionPage\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\",{\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"fedibird\\":\\"http://fedibird.com/ns#\\",\\"ChatMessage\\":\\"http://litepub.social/ns#ChatMessage\\",\\"sensitive\\":\\"as:sensitive\\",\\"votersCount\\":\\"toot:votersCount\\",\\"Emoji\\":\\"toot:Emoji\\",\\"Hashtag\\":\\"as:Hashtag\\",\\"quote\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quote\\",\\"@type\\":\\"@id\\"},\\"quoteUrl\\":\\"as:quoteUrl\\",\\"_misskey_quote\\":\\"misskey:_misskey_quote\\",\\"quoteUri\\":\\"fedibird:quoteUri\\",\\"QuoteAuthorization\\":\\"https://w3id.org/fep/044f#QuoteAuthorization\\",\\"QuoteRequest\\":\\"https://w3id.org/fep/044f#QuoteRequest\\",\\"quoteAuthorization\\":{\\"@id\\":\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"@type\\":\\"@id\\"},\\"emojiReactions\\":{\\"@id\\":\\"fedibird:emojiReactions\\",\\"@type\\":\\"@id\\"}}]; return result; } @@ -67985,7 +67602,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -68016,7 +67633,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#OrderedCollectionPage\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -68134,11 +67751,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -68179,11 +67796,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -68226,7 +67839,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -73031,7 +72647,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73051,7 +72667,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73087,7 +72703,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73111,7 +72727,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73135,7 +72751,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73155,7 +72771,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73175,7 +72791,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73195,7 +72811,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73215,7 +72831,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73235,7 +72851,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73339,7 +72955,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73375,7 +72991,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73411,7 +73027,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73461,7 +73077,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Organization\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -73500,7 +73116,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73515,7 +73131,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73545,7 +73161,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73560,7 +73176,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73575,7 +73191,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73590,7 +73206,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73605,7 +73221,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73620,7 +73236,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73635,7 +73251,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73650,7 +73266,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73740,7 +73356,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73755,7 +73371,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73770,7 +73386,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73813,7 +73429,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Organization\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -73941,11 +73557,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -74010,11 +73626,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74044,11 +73656,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74096,11 +73704,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74138,11 +73742,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74180,11 +73780,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74214,11 +73810,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74248,11 +73840,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74282,11 +73870,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74316,11 +73900,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74350,11 +73930,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74477,11 +74053,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74531,11 +74103,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74585,11 +74153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -74640,7 +74204,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -75285,7 +74852,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Page\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -75304,7 +74871,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Page\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -75422,11 +74989,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -75452,7 +75019,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -80215,7 +79785,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80235,7 +79805,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80271,7 +79841,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80295,7 +79865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80319,7 +79889,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80339,7 +79909,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80359,7 +79929,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80379,7 +79949,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80399,7 +79969,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80419,7 +79989,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80523,7 +80093,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80559,7 +80129,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80595,7 +80165,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80645,7 +80215,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Person\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -80684,7 +80254,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80699,7 +80269,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80729,7 +80299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80744,7 +80314,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80759,7 +80329,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80774,7 +80344,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80789,7 +80359,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80804,7 +80374,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80819,7 +80389,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80834,7 +80404,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80924,7 +80494,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80939,7 +80509,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80954,7 +80524,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80997,7 +80567,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Person\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -81125,11 +80695,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -81194,11 +80764,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81228,11 +80794,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81280,11 +80842,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81322,11 +80880,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81364,11 +80918,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81398,11 +80948,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81432,11 +80978,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81466,11 +81008,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81500,11 +81038,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81534,11 +81068,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81661,11 +81191,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81715,11 +81241,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81769,11 +81291,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -81824,7 +81342,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -82806,7 +82327,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { const item = ( - v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? v : v.href + v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? v : formatIri(v) ); compactItems.push(item); } @@ -82820,7 +82341,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Place\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -82931,7 +82452,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { const element = ( - v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? { \\"@value\\": v } : { \\"@id\\": v.href } + v == \\"cm\\" || v == \\"feet\\" || v == \\"inches\\" || v == \\"km\\" || v == \\"m\\" || v == \\"miles\\" ? { \\"@value\\": v } : { \\"@id\\": formatIri(v) } ); array.push(element);; } @@ -82944,7 +82465,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Place\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -83062,11 +82583,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -83196,22 +82717,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu typeof v === \\"object\\" && \\"@value\\" in v && (v[\\"@value\\"] == \\"cm\\" || v[\\"@value\\"] == \\"feet\\" || v[\\"@value\\"] == \\"inches\\" || v[\\"@value\\"] == \\"km\\" || v[\\"@value\\"] == \\"m\\" || v[\\"@value\\"] == \\"miles\\") ? v[\\"@value\\"] : v != null && typeof v === \\"object\\" && \\"@id\\" in v && typeof v[\\"@id\\"] === \\"string\\" - && v[\\"@id\\"] !== \\"\\" ? v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + - encodeURIComponent( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(5, v[\\"@id\\"].indexOf(\\"/\\", 5)) - : v[\\"@id\\"].slice(5) - ) + - ( - v[\\"@id\\"].includes(\\"/\\", 5) - ? v[\\"@id\\"].slice(v[\\"@id\\"].indexOf(\\"/\\", 5)) - : \\"\\" - ) - ) - : URL.canParse(v[\\"@id\\"]) && options.baseUrl - ? new URL(v[\\"@id\\"]) - : new URL(v[\\"@id\\"], options.baseUrl) : undefined + && v[\\"@id\\"] !== \\"\\" ? parseIri(v[\\"@id\\"], options.baseUrl) : undefined ; if (typeof decoded === \\"undefined\\") continue; _oKrwxU4V8wiKhMW1QEYQibcJh8c_units.push(decoded); @@ -83221,7 +82727,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -83777,7 +83286,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -83795,7 +83304,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result[\\"type\\"] = \\"Profile\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -83816,7 +83325,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -83829,7 +83338,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Profile\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -83947,11 +83456,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -83992,11 +83501,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -84011,7 +83516,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -85419,7 +84927,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85434,7 +84942,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85485,7 +84993,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85500,7 +85008,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { \\"@value\\": v.href } + { \\"@value\\": formatIri(v) } ); array.push(element);; } @@ -85519,7 +85027,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85532,7 +85040,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Question\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -85650,11 +85158,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -85695,11 +85203,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -85729,11 +85233,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -85812,11 +85312,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -85849,7 +85345,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ) { if (v == null) continue; - const decoded = new URL(v[\\"@value\\"]); + const decoded = parseIri(v[\\"@value\\"]); if (typeof decoded === \\"undefined\\") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -85872,11 +85368,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -85891,7 +85383,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -86223,7 +85718,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Read\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -86341,11 +85836,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -86371,7 +85866,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -86560,7 +86058,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Reject\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -86678,11 +86176,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -86712,7 +86210,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -87992,7 +87493,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88012,7 +87513,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88032,7 +87533,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88050,7 +87551,7 @@ relationships?: (Object | URL)[];} } result[\\"type\\"] = \\"Relationship\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -88071,7 +87572,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88086,7 +87587,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88101,7 +87602,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88114,7 +87615,7 @@ relationships?: (Object | URL)[];} } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Relationship\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -88232,11 +87733,11 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -88277,11 +87778,7 @@ relationships?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -88311,11 +87808,7 @@ relationships?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -88345,11 +87838,7 @@ relationships?: (Object | URL)[];} if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -88364,7 +87853,10 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -88625,7 +88117,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Remove\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -88743,11 +88235,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -88773,7 +88265,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -93536,7 +93031,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93556,7 +93051,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93592,7 +93087,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93616,7 +93111,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93640,7 +93135,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93660,7 +93155,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93680,7 +93175,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93700,7 +93195,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93720,7 +93215,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93740,7 +93235,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93844,7 +93339,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93880,7 +93375,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93916,7 +93411,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93966,7 +93461,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result[\\"type\\"] = \\"Service\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/v1\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://www.w3.org/ns/did/v1\\",\\"https://w3id.org/security/multikey/v1\\",\\"https://gotosocial.org/ns\\",{\\"alsoKnownAs\\":{\\"@id\\":\\"as:alsoKnownAs\\",\\"@type\\":\\"@id\\"},\\"manuallyApprovesFollowers\\":\\"as:manuallyApprovesFollowers\\",\\"movedTo\\":{\\"@id\\":\\"as:movedTo\\",\\"@type\\":\\"@id\\"},\\"toot\\":\\"http://joinmastodon.org/ns#\\",\\"Emoji\\":\\"toot:Emoji\\",\\"featured\\":{\\"@id\\":\\"toot:featured\\",\\"@type\\":\\"@id\\"},\\"featuredTags\\":{\\"@id\\":\\"toot:featuredTags\\",\\"@type\\":\\"@id\\"},\\"discoverable\\":\\"toot:discoverable\\",\\"suspended\\":\\"toot:suspended\\",\\"memorial\\":\\"toot:memorial\\",\\"indexable\\":\\"toot:indexable\\",\\"schema\\":\\"http://schema.org#\\",\\"PropertyValue\\":\\"schema:PropertyValue\\",\\"value\\":\\"schema:value\\",\\"misskey\\":\\"https://misskey-hub.net/ns#\\",\\"_misskey_followedMessage\\":\\"misskey:_misskey_followedMessage\\",\\"isCat\\":\\"misskey:isCat\\"}]; return result; } @@ -94005,7 +93500,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94020,7 +93515,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94050,7 +93545,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94065,7 +93560,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94080,7 +93575,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94095,7 +93590,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94110,7 +93605,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94125,7 +93620,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94140,7 +93635,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94155,7 +93650,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94245,7 +93740,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94260,7 +93755,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94275,7 +93770,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { \\"@id\\": v.href } : await v.toJsonLd(options) + v instanceof URL ? { \\"@id\\": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94318,7 +93813,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Service\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -94446,11 +93941,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -94515,11 +94010,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94549,11 +94040,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94601,11 +94088,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94643,11 +94126,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94685,11 +94164,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94719,11 +94194,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94753,11 +94224,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94787,11 +94254,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94821,11 +94284,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94855,11 +94314,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -94982,11 +94437,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -95036,11 +94487,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -95090,11 +94537,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === \\"object\\" && \\"@id\\" in v && !(\\"@type\\" in v) && globalThis.Object.keys(v).length === 1) { if (v[\\"@id\\"].startsWith(\\"_:\\")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v[\\"@id\\"], options.baseUrl) && v[\\"@id\\"].startsWith(\\"at://\\") - ? new URL(\\"at://\\" + encodeURIComponent(v[\\"@id\\"].substring(5))) - : new URL(v[\\"@id\\"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v[\\"@id\\"], options.baseUrl)); continue; } @@ -95145,7 +94588,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -95989,7 +95435,7 @@ get contents(): ((string | LanguageString))[] { } - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = \\"https://www.w3.org/ns/activitystreams\\"; return result; } @@ -96031,7 +95477,7 @@ get contents(): ((string | LanguageString))[] { } - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -96143,11 +95589,11 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -96162,7 +95608,7 @@ get contents(): ((string | LanguageString))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"], options.baseUrl) ? new URL(values[\\"@id\\"], options.baseUrl) : undefined }, + { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, ); const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; @@ -96210,7 +95656,10 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -96460,7 +95909,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#TentativeAccept\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -96578,11 +96027,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -96608,7 +96057,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -96797,7 +96249,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#TentativeReject\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -96915,11 +96367,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -96945,7 +96397,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -97293,7 +96748,7 @@ get formerTypes(): ($EntityType)[] { } result[\\"type\\"] = \\"Tombstone\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -97345,7 +96800,7 @@ get formerTypes(): ($EntityType)[] { } values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Tombstone\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -97468,11 +96923,11 @@ get formerTypes(): ($EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -97551,7 +97006,10 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -97788,7 +97246,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Travel\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -97906,11 +97364,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -97936,7 +97394,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -98130,7 +97591,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Undo\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -98248,11 +97709,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -98278,7 +97739,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -98470,7 +97934,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Update\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -98588,11 +98052,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -98618,7 +98082,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -98791,7 +98258,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result[\\"type\\"] = \\"Video\\"; - if (this.id != null) result[\\"id\\"] = this.id.href; + if (this.id != null) result[\\"id\\"] = formatIri(this.id); result[\\"@context\\"] = [\\"https://www.w3.org/ns/activitystreams\\",\\"https://w3id.org/security/data-integrity/v1\\",\\"https://gotosocial.org/ns\\"]; return result; } @@ -98810,7 +98277,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#Video\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -98928,11 +98395,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -98958,7 +98425,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", @@ -99146,7 +98616,7 @@ instruments?: (Object | URL)[];} >; values[\\"@type\\"] = [\\"https://www.w3.org/ns/activitystreams#View\\"]; - if (this.id != null) values[\\"@id\\"] = this.id.href; + if (this.id != null) values[\\"@id\\"] = formatIri(this.id); if (options.format === \\"expand\\") { return await jsonld.expand( values, @@ -99264,11 +98734,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !URL.canParse(values[\\"@id\\"], options.baseUrl)) { + if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && URL.canParse(values[\\"@id\\"])) { - options = { ...options, baseUrl: new URL(values[\\"@id\\"]) }; + if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } if (\\"@type\\" in values) { @@ -99294,7 +98764,10 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( \\"Failed to cache JSON-LD: {json}\\", diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 2a93e71a3..b18685c3f 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -8,17 +8,20 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from "@opentelemetry/api"; import { canParseDecimal, + canParseIri, decodeMultibase, type Decimal, type DocumentLoader, encodeMultibase, exportMultibaseKey, exportSpki, + formatIri, getDocumentLoader, importMultibaseKey, importPem, isDecimal, LanguageString, + parseIri, parseDecimal, type RemoteDocument } from "@fedify/vocab-runtime"; @@ -9118,7 +9121,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9146,7 +9149,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9182,7 +9185,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9221,7 +9224,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9280,7 +9283,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9304,7 +9307,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9324,7 +9327,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9344,7 +9347,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9368,7 +9371,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9392,7 +9395,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const item = ( - v instanceof URL ? v.href : v instanceof Link ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Link ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9432,7 +9435,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9452,7 +9455,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9472,7 +9475,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9492,7 +9495,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9547,7 +9550,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9587,7 +9590,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9607,7 +9610,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9627,7 +9630,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9647,7 +9650,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9667,7 +9670,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9755,7 +9758,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9795,7 +9798,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -9811,7 +9814,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9831,7 +9834,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9851,7 +9854,7 @@ get urls(): ((URL | Link))[] { compactItems = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -9869,7 +9872,7 @@ get urls(): ((URL | Link))[] { } result["type"] = "Object"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"fedibird":"http://fedibird.com/ns#","sensitive":"as:sensitive","emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; return result; } @@ -9880,7 +9883,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9895,7 +9898,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9910,7 +9913,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -9943,7 +9946,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -9994,7 +9997,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10009,7 +10012,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10024,7 +10027,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10039,7 +10042,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10054,7 +10057,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10069,7 +10072,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10102,7 +10105,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_7UpwM3JWcXhADcscukEehBorf6k_replies) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10117,7 +10120,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10132,7 +10135,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10147,7 +10150,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10198,7 +10201,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -10231,7 +10234,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_2oPEH9MQ3aj8JVwyYuWkqoVwV865_url) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10246,7 +10249,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10261,7 +10264,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10276,7 +10279,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10291,7 +10294,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10369,7 +10372,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push({ "@graph": element });; } @@ -10399,7 +10402,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -10414,7 +10417,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10429,7 +10432,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10444,7 +10447,7 @@ get urls(): ((URL | Link))[] { array = []; for (const v of this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -10457,7 +10460,7 @@ get urls(): ((URL | Link))[] { } values["@type"] = ["https://www.w3.org/ns/activitystreams#Object"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -10600,11 +10603,11 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -10875,7 +10878,7 @@ get urls(): ((URL | Link))[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); @@ -10896,11 +10899,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _49BipA5dq9eoH8LX8xdsVumveTca_attachment.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _49BipA5dq9eoH8LX8xdsVumveTca_attachment.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -10944,11 +10943,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -10998,11 +10993,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11056,11 +11047,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3mhZzGXSpQ431mBSz2kvych22v4e_context.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3mhZzGXSpQ431mBSz2kvych22v4e_context.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11146,11 +11133,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _86xFhmgBapoMvYqjbjRuDPayTrS_generator.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _86xFhmgBapoMvYqjbjRuDPayTrS_generator.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11212,11 +11195,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11268,11 +11247,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3dXrUdkARxwyJLtJcYi1AJ92H41U_image.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11302,11 +11277,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11346,11 +11317,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _31k5MUZJsnsPNg8dQQJieWaXTFnR_location.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _31k5MUZJsnsPNg8dQQJieWaXTFnR_location.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11390,11 +11357,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11456,11 +11419,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _7UpwM3JWcXhADcscukEehBorf6k_replies.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _7UpwM3JWcXhADcscukEehBorf6k_replies.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11490,11 +11449,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3kAfck9PcEYt2L7xug5y99YPbANs_shares.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11524,11 +11479,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11558,11 +11509,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11638,11 +11585,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _5chuqj6s95p5gg2sk1HntGfarRf_tag.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _5chuqj6s95p5gg2sk1HntGfarRf_tag.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11702,22 +11645,7 @@ get urls(): ((URL | Link))[] { const decoded = v != null && typeof v === "object" && "@id" in v && typeof v["@id"] === "string" - && v["@id"] !== "" ? v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl) : typeof v === "object" && "@type" in v + && v["@id"] !== "" ? parseIri(v["@id"], options.baseUrl) : typeof v === "object" && "@type" in v && Array.isArray(v["@type"])&& ["https://www.w3.org/ns/activitystreams#Link","https://www.w3.org/ns/activitystreams#Hashtag","https://www.w3.org/ns/activitystreams#Mention"].some( t => v["@type"].includes(t)) ? await Link.fromJsonLd( v, @@ -11747,11 +11675,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11781,11 +11705,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11815,11 +11735,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11849,11 +11765,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -11958,11 +11870,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -12008,22 +11916,7 @@ get urls(): ((URL | Link))[] { ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _23YiVs2miQcEiUdn4u8SvjQKWYim_approvedBy.push(decoded); } @@ -12046,11 +11939,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -12080,11 +11969,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -12114,11 +11999,7 @@ get urls(): ((URL | Link))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -12133,7 +12014,10 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -13165,7 +13049,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result["type"] = "Emoji"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams",{"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji"}]; return result; } @@ -13184,7 +13068,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values["@type"] = ["http://joinmastodon.org/ns#Emoji"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -13302,11 +13186,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -13332,7 +13216,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -14075,7 +13962,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -14095,7 +13982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -14121,7 +14008,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -14139,7 +14026,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "ChatMessage"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"toot":"http://joinmastodon.org/ns#","misskey":"https://misskey-hub.net/ns#","fedibird":"http://fedibird.com/ns#","Emoji":"toot:Emoji","ChatMessage":"http://litepub.social/ns#ChatMessage","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"quoteUrl":"as:quoteUrl","_misskey_quote":"misskey:_misskey_quote","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; return result; } @@ -14160,7 +14047,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -14175,7 +14062,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { "@value": v.href } + { "@value": formatIri(v) } ); array.push(element);; } @@ -14194,7 +14081,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -14207,7 +14094,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["http://litepub.social/ns#ChatMessage"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -14325,11 +14212,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -14370,11 +14257,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -14407,7 +14290,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v["@value"]); + const decoded = parseIri(v["@value"]); if (typeof decoded === "undefined") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -14430,11 +14313,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -14449,7 +14328,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -17265,7 +17147,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -17280,7 +17162,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17295,7 +17177,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17310,7 +17192,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17325,7 +17207,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17340,7 +17222,7 @@ instruments?: (Object | URL)[];} array = []; for (const v of this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -17353,7 +17235,7 @@ instruments?: (Object | URL)[];} } values["@type"] = ["https://www.w3.org/ns/activitystreams#Activity"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -17471,11 +17353,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -17652,11 +17534,7 @@ instruments?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -17706,11 +17584,7 @@ instruments?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -17740,11 +17614,7 @@ instruments?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -17774,11 +17644,7 @@ instruments?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -17808,11 +17674,7 @@ instruments?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _25zu2s3VxVujgEKqrDycjE284XQR_origin.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _25zu2s3VxVujgEKqrDycjE284XQR_origin.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -17842,11 +17704,7 @@ instruments?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -17861,7 +17719,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -18205,7 +18066,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["http://litepub.social/ns#EmojiReact"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -18323,11 +18184,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -18353,7 +18214,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -18674,7 +18538,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } result["type"] = "PropertyValue"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams",{"schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value"}]; return result; } @@ -18719,7 +18583,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } values["@type"] = ["http://schema.org#PropertyValue"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -18836,11 +18700,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -18855,7 +18719,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; @@ -18909,7 +18773,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -19283,7 +19150,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } result["type"] = "om2:Measure"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams",{"om2":"http://www.ontology-of-units-of-measure.org/resource/om-2/","hasUnit":"om2:hasUnit","hasNumericalValue":"om2:hasNumericalValue"}]; return result; } @@ -19325,7 +19192,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } values["@type"] = ["http://www.ontology-of-units-of-measure.org/resource/om-2/Measure"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -19432,11 +19299,11 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -19451,7 +19318,7 @@ unit?: string | null;numericalValue?: Decimal | null;} } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _27fgyFbosTtMAhuepJH8K3ZGURT6: (string)[] = []; @@ -19493,7 +19360,10 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -20243,7 +20113,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -20263,7 +20133,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -20281,7 +20151,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "AnnounceAuthorization"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -20302,7 +20172,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -20317,7 +20187,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -20330,7 +20200,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://gotosocial.org/ns#AnnounceAuthorization"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -20448,11 +20318,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -20493,11 +20363,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -20527,11 +20393,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -20546,7 +20408,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -20784,7 +20649,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://gotosocial.org/ns#AnnounceRequest"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -20902,11 +20767,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -20932,7 +20797,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -21376,7 +21244,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -21503,11 +21371,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -21522,7 +21390,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike: (InteractionRule)[] = []; @@ -21612,7 +21480,10 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -22126,7 +21997,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -22141,7 +22012,7 @@ get manualApprovals(): (URL)[] { array = []; for (const v of this.#_sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -22154,7 +22025,7 @@ get manualApprovals(): (URL)[] { } - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -22261,11 +22132,11 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -22280,7 +22151,7 @@ get manualApprovals(): (URL)[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval: (URL)[] = []; @@ -22296,22 +22167,7 @@ get manualApprovals(): (URL)[] { ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval.push(decoded); } @@ -22329,22 +22185,7 @@ get manualApprovals(): (URL)[] { ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _sxj8y5XMMMBWUnRYFw85MKedCMj_manualApproval.push(decoded); } @@ -22352,7 +22193,10 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -23113,7 +22957,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -23133,7 +22977,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -23151,7 +22995,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "LikeAuthorization"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -23172,7 +23016,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -23187,7 +23031,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -23200,7 +23044,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://gotosocial.org/ns#LikeApproval"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -23318,11 +23162,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -23363,11 +23207,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -23397,11 +23237,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -23416,7 +23252,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -23653,7 +23492,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://gotosocial.org/ns#LikeRequest"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -23771,11 +23610,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -23801,7 +23640,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -24495,7 +24337,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -24515,7 +24357,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -24533,7 +24375,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "ReplyAuthorization"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -24554,7 +24396,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -24569,7 +24411,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -24582,7 +24424,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://gotosocial.org/ns#ReplyAuthorization"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -24700,11 +24542,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -24745,11 +24587,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -24779,11 +24617,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -24798,7 +24632,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -25035,7 +24872,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://gotosocial.org/ns#ReplyRequest"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -25153,11 +24990,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -25183,7 +25020,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -25876,7 +25716,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -25896,7 +25736,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -25914,7 +25754,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "QuoteAuthorization"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization"}]; return result; } @@ -25935,7 +25775,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -25950,7 +25790,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -25963,7 +25803,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://w3id.org/fep/044f#QuoteAuthorization"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -26081,11 +25921,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -26126,11 +25966,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -26160,11 +25996,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -26179,7 +26011,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -26416,7 +26251,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://w3id.org/fep/044f#QuoteRequest"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -26534,11 +26369,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -26564,7 +26399,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -26869,7 +26707,7 @@ get endpoints(): (URL)[] { array = []; for (const v of this.#_2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -26882,7 +26720,7 @@ get endpoints(): (URL)[] { } values["@type"] = ["https://www.w3.org/ns/did#Service"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -26989,11 +26827,11 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -27012,7 +26850,7 @@ get endpoints(): (URL)[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint: (URL)[] = []; @@ -27028,22 +26866,7 @@ get endpoints(): (URL)[] { ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint.push(decoded); } @@ -27051,7 +26874,10 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -27238,7 +27064,7 @@ endpoints?: (URL)[];} >; values["@type"] = ["https://w3id.org/fep/9091#Export"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -27345,11 +27171,11 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -27375,7 +27201,10 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -28000,7 +27829,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null array = []; for (const v of this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -28066,7 +27895,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } values["@type"] = ["https://w3id.org/security#DataIntegrityProof"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -28173,11 +28002,11 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -28192,7 +28021,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: ("eddsa-jcs-2022")[] = []; @@ -28231,11 +28060,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -28308,7 +28133,10 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -28964,7 +28792,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi compactItems = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -29014,7 +28842,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } result["type"] = "CryptographicKey"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = "https://w3id.org/security/v1"; return result; } @@ -29025,7 +28853,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi array = []; for (const v of this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -29053,7 +28881,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } values["@type"] = ["https://w3id.org/security#Key"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -29160,11 +28988,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -29179,7 +29007,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); @@ -29200,11 +29028,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -29257,7 +29081,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -29861,7 +29688,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; compactItems = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -29911,7 +29738,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } result["type"] = "Multikey"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = "https://w3id.org/security/multikey/v1"; return result; } @@ -29922,7 +29749,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; array = []; for (const v of this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -29953,7 +29780,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } values["@type"] = ["https://w3id.org/security#Multikey"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -30060,11 +29887,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -30079,7 +29906,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); @@ -30100,11 +29927,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -30157,7 +29980,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -30523,7 +30349,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "Agreement"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"vf":"https://w3id.org/valueflows/ont/vf#","om2":"http://www.ontology-of-units-of-measure.org/resource/om-2/","fedibird":"http://fedibird.com/ns#","sensitive":"as:sensitive","emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"},"Agreement":"vf:Agreement","Commitment":"vf:Commitment","stipulates":"vf:stipulates","stipulatesReciprocal":"vf:stipulatesReciprocal","satisfies":{"@id":"vf:satisfies","@type":"@id"},"resourceQuantity":"vf:resourceQuantity","hasUnit":"om2:hasUnit","hasNumericalValue":"om2:hasNumericalValue"}]; return result; } @@ -30572,7 +30398,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://w3id.org/valueflows/ont/vf#Agreement"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -30690,11 +30516,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -30762,7 +30588,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -31099,7 +30928,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} compactItems = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -31133,7 +30962,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } result["type"] = "Commitment"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams",{"vf":"https://w3id.org/valueflows/ont/vf#","om2":"http://www.ontology-of-units-of-measure.org/resource/om-2/","Commitment":"vf:Commitment","satisfies":{"@id":"vf:satisfies","@type":"@id"},"resourceQuantity":"vf:resourceQuantity","hasUnit":"om2:hasUnit","hasNumericalValue":"om2:hasNumericalValue"}]; return result; } @@ -31144,7 +30973,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} array = []; for (const v of this.#_aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -31172,7 +31001,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } values["@type"] = ["https://w3id.org/valueflows/ont/vf#Commitment"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -31279,11 +31108,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -31298,7 +31127,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies: (URL)[] = []; @@ -31314,22 +31143,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies.push(decoded); } @@ -31358,7 +31172,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -31842,7 +31659,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur compactItems = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -31916,7 +31733,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } result["type"] = "Intent"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams",{"vf":"https://w3id.org/valueflows/ont/vf#","om2":"http://www.ontology-of-units-of-measure.org/resource/om-2/","Intent":"vf:Intent","action":"vf:action","resourceConformsTo":{"@id":"vf:resourceConformsTo","@type":"@id"},"resourceQuantity":"vf:resourceQuantity","availableQuantity":"vf:availableQuantity","minimumQuantity":"vf:minimumQuantity","hasUnit":"om2:hasUnit","hasNumericalValue":"om2:hasNumericalValue"}]; return result; } @@ -31942,7 +31759,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur array = []; for (const v of this.#_BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -32000,7 +31817,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } values["@type"] = ["https://w3id.org/valueflows/ont/vf#Intent"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -32107,11 +31924,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -32126,7 +31943,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action: (string)[] = []; @@ -32160,22 +31977,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _BBAeMUUQDwBQn6cvu3P2Csd6b6h_resourceConformsTo.push(decoded); } @@ -32246,7 +32048,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -32785,7 +32590,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "Proposal"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"vf":"https://w3id.org/valueflows/ont/vf#","om2":"http://www.ontology-of-units-of-measure.org/resource/om-2/","fedibird":"http://fedibird.com/ns#","sensitive":"as:sensitive","emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"},"Proposal":"vf:Proposal","Intent":"vf:Intent","purpose":"vf:purpose","unitBased":"vf:unitBased","publishes":"vf:publishes","reciprocal":"vf:reciprocal","action":"vf:action","resourceConformsTo":{"@id":"vf:resourceConformsTo","@type":"@id"},"resourceQuantity":"vf:resourceQuantity","availableQuantity":"vf:availableQuantity","minimumQuantity":"vf:minimumQuantity","hasUnit":"om2:hasUnit","hasNumericalValue":"om2:hasNumericalValue"}]; return result; } @@ -32864,7 +32669,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://w3id.org/valueflows/ont/vf#Proposal"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -32982,11 +32787,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -33090,7 +32895,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -33360,7 +33168,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Accept"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -33478,11 +33286,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -33512,7 +33320,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -33703,7 +33514,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Add"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -33821,11 +33632,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -33851,7 +33662,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -34041,7 +33855,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Announce"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -34159,11 +33973,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -34189,7 +34003,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -38952,7 +38769,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -38972,7 +38789,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39008,7 +38825,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39032,7 +38849,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39056,7 +38873,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39076,7 +38893,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39096,7 +38913,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39116,7 +38933,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39136,7 +38953,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39156,7 +38973,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39260,7 +39077,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39296,7 +39113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39332,7 +39149,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -39382,7 +39199,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result["type"] = "Application"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -39421,7 +39238,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39436,7 +39253,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39466,7 +39283,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39481,7 +39298,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39496,7 +39313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39511,7 +39328,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39526,7 +39343,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39541,7 +39358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39556,7 +39373,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39571,7 +39388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39661,7 +39478,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39676,7 +39493,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -39691,7 +39508,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -39734,7 +39551,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values["@type"] = ["https://www.w3.org/ns/activitystreams#Application"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -39862,11 +39679,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -39931,11 +39748,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -39965,11 +39778,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40017,11 +39826,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40059,11 +39864,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40101,11 +39902,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40135,11 +39932,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40169,11 +39962,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40203,11 +39992,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40237,11 +40022,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40271,11 +40052,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40398,11 +40175,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40452,11 +40225,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40506,11 +40275,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -40561,7 +40326,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -41223,7 +40991,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#IntransitiveActivity"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -41341,11 +41109,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -41383,7 +41151,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -41573,7 +41344,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Arrive"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -41691,11 +41462,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -41721,7 +41492,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -42459,7 +42233,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -42479,7 +42253,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -42505,7 +42279,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -42523,7 +42297,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "Article"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"toot":"http://joinmastodon.org/ns#","misskey":"https://misskey-hub.net/ns#","fedibird":"http://fedibird.com/ns#","sensitive":"as:sensitive","Emoji":"toot:Emoji","Hashtag":"as:Hashtag","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"quoteUrl":"as:quoteUrl","_misskey_quote":"misskey:_misskey_quote","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; return result; } @@ -42544,7 +42318,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -42559,7 +42333,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { "@value": v.href } + { "@value": formatIri(v) } ); array.push(element);; } @@ -42578,7 +42352,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -42591,7 +42365,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#Article"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -42709,11 +42483,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -42754,11 +42528,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -42791,7 +42561,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v["@value"]); + const decoded = parseIri(v["@value"]); if (typeof decoded === "undefined") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -42814,11 +42584,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -42833,7 +42599,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -43182,7 +42951,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "Document"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -43237,7 +43006,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#Document"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -43355,11 +43124,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -43437,7 +43206,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -43650,7 +43422,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result["type"] = "Audio"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -43669,7 +43441,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Audio"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -43787,11 +43559,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -43817,7 +43589,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -44006,7 +43781,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Ignore"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -44124,11 +43899,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -44158,7 +43933,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -44349,7 +44127,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Block"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -44467,11 +44245,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -44497,7 +44275,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -47824,7 +47605,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47844,7 +47625,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47864,7 +47645,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47884,7 +47665,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47908,7 +47689,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47928,7 +47709,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47948,7 +47729,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47968,7 +47749,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -47988,7 +47769,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48008,7 +47789,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48028,7 +47809,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48048,7 +47829,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -48066,7 +47847,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "Collection"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"toot":"http://joinmastodon.org/ns#","misskey":"https://misskey-hub.net/ns#","fedibird":"http://fedibird.com/ns#","ChatMessage":"http://litepub.social/ns#ChatMessage","sensitive":"as:sensitive","votersCount":"toot:votersCount","Emoji":"toot:Emoji","Hashtag":"as:Hashtag","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"quoteUrl":"as:quoteUrl","_misskey_quote":"misskey:_misskey_quote","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","QuoteRequest":"https://w3id.org/fep/044f#QuoteRequest","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; return result; } @@ -48105,7 +47886,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48120,7 +47901,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48135,7 +47916,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48150,7 +47931,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -48165,7 +47946,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48180,7 +47961,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48195,7 +47976,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48210,7 +47991,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48225,7 +48006,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48240,7 +48021,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48255,7 +48036,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48270,7 +48051,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -48283,7 +48064,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#Collection"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -48401,11 +48182,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -48476,11 +48257,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3UyUdxnyn6cDn53QKrh4MBiearma_current.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3UyUdxnyn6cDn53QKrh4MBiearma_current.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48510,11 +48287,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _J52RqweMe6hhv7RnLJMC8BExTE5_first.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _J52RqweMe6hhv7RnLJMC8BExTE5_first.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48544,11 +48317,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48578,11 +48347,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48622,11 +48387,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48656,11 +48417,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48690,11 +48447,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48724,11 +48477,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48758,11 +48507,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48792,11 +48537,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48826,11 +48567,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48860,11 +48597,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -48879,7 +48612,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -50084,7 +49820,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50104,7 +49840,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50124,7 +49860,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -50142,7 +49878,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "CollectionPage"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"toot":"http://joinmastodon.org/ns#","misskey":"https://misskey-hub.net/ns#","fedibird":"http://fedibird.com/ns#","ChatMessage":"http://litepub.social/ns#ChatMessage","sensitive":"as:sensitive","votersCount":"toot:votersCount","Emoji":"toot:Emoji","Hashtag":"as:Hashtag","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"quoteUrl":"as:quoteUrl","_misskey_quote":"misskey:_misskey_quote","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","QuoteRequest":"https://w3id.org/fep/044f#QuoteRequest","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; return result; } @@ -50163,7 +49899,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50178,7 +49914,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50193,7 +49929,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -50206,7 +49942,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#CollectionPage"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -50324,11 +50060,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -50373,11 +50109,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -50407,11 +50139,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -50441,11 +50169,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -50460,7 +50184,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -50707,7 +50434,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Create"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -50825,11 +50552,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -50855,7 +50582,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -51044,7 +50774,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Delete"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -51162,11 +50892,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -51192,7 +50922,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -51379,7 +51112,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Dislike"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -51497,11 +51230,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -51527,7 +51260,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -52001,7 +51737,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52017,7 +51753,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52033,7 +51769,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52049,7 +51785,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52065,7 +51801,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52081,7 +51817,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint compactItems = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -52095,7 +51831,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = "https://www.w3.org/ns/activitystreams"; return result; } @@ -52106,7 +51842,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -52121,7 +51857,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -52136,7 +51872,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -52151,7 +51887,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -52166,7 +51902,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -52181,7 +51917,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint array = []; for (const v of this.#_3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -52194,7 +51930,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -52301,11 +52037,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -52320,7 +52056,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl: (URL)[] = []; @@ -52336,22 +52072,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl.push(decoded); } @@ -52369,22 +52090,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _25S6UmgzDead8hxL5sQFezZTAusd_oauthAuthorizationEndpoint.push(decoded); } @@ -52402,22 +52108,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _iAMxqrSba7yBCRB1FZ5kEVdKEZ3_oauthTokenEndpoint.push(decoded); } @@ -52435,22 +52126,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _8Bx9qN8oU7Bpt2xi6khaxWp1gMr_provideClientKey.push(decoded); } @@ -52468,22 +52144,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _3dU7PMVQZJpsCpo2F4RQXxBXdPmS_signClientKey.push(decoded); } @@ -52501,22 +52162,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _3JprUSDLVqqX4dwHRi37qGZZCRCc_sharedInbox.push(decoded); } @@ -52524,7 +52170,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -52832,7 +52481,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result["type"] = "Event"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -52851,7 +52500,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Event"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -52969,11 +52618,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -52999,7 +52648,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -53189,7 +52841,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Flag"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -53307,11 +52959,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -53337,7 +52989,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -53528,7 +53183,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Follow"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -53646,11 +53301,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -53676,7 +53331,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -58439,7 +58097,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58459,7 +58117,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58495,7 +58153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58519,7 +58177,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58543,7 +58201,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58563,7 +58221,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58583,7 +58241,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58603,7 +58261,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58623,7 +58281,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58643,7 +58301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58747,7 +58405,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58783,7 +58441,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58819,7 +58477,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -58869,7 +58527,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result["type"] = "Group"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -58908,7 +58566,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58923,7 +58581,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58953,7 +58611,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -58968,7 +58626,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -58983,7 +58641,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -58998,7 +58656,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59013,7 +58671,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59028,7 +58686,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59043,7 +58701,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59058,7 +58716,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59148,7 +58806,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -59163,7 +58821,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -59178,7 +58836,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -59221,7 +58879,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values["@type"] = ["https://www.w3.org/ns/activitystreams#Group"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -59349,11 +59007,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -59418,11 +59076,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59452,11 +59106,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59504,11 +59154,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59546,11 +59192,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59588,11 +59230,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59622,11 +59260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59656,11 +59290,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59690,11 +59320,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59724,11 +59350,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59758,11 +59380,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59885,11 +59503,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59939,11 +59553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -59993,11 +59603,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -60048,7 +59654,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -61425,7 +61034,7 @@ get names(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -61540,7 +61149,7 @@ get names(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const item = ( - v instanceof URL ? v.href : v instanceof Link ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Link ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -61562,7 +61171,7 @@ get names(): ((string | LanguageString))[] { } result["type"] = "Link"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = "https://www.w3.org/ns/activitystreams"; return result; } @@ -61573,7 +61182,7 @@ get names(): ((string | LanguageString))[] { array = []; for (const v of this.#_pVjLsybKQdmkjuU7MHjiVmNnuj7_href) { const element = ( - { "@id": v.href } + { "@id": formatIri(v) } ); array.push(element);; } @@ -61687,7 +61296,7 @@ get names(): ((string | LanguageString))[] { array = []; for (const v of this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Link ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -61700,7 +61309,7 @@ get names(): ((string | LanguageString))[] { } values["@type"] = ["https://www.w3.org/ns/activitystreams#Link"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -61812,11 +61421,11 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -61839,7 +61448,7 @@ get names(): ((string | LanguageString))[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; @@ -61855,22 +61464,7 @@ get names(): ((string | LanguageString))[] { ) { if (v == null) continue; - const decoded = v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl); + const decoded = parseIri(v["@id"], options.baseUrl); if (typeof decoded === "undefined") continue; _pVjLsybKQdmkjuU7MHjiVmNnuj7_href.push(decoded); } @@ -62007,11 +61601,7 @@ get names(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _gCVTegXxWWCw6wWRxa1QF65zusg_preview.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -62036,7 +61626,10 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -62373,7 +61966,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let compactItems: unknown[]; result["type"] = "Hashtag"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams",{"Hashtag":"as:Hashtag"}]; return result; } @@ -62392,7 +61985,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Hashtag"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -62499,11 +62092,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -62529,7 +62122,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -62702,7 +62298,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result["type"] = "Image"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -62721,7 +62317,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Image"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -62839,11 +62435,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -62869,7 +62465,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -63059,7 +62658,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Offer"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -63177,11 +62776,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -63211,7 +62810,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -63400,7 +63002,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Invite"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -63518,11 +63120,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -63548,7 +63150,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -63737,7 +63342,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Join"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -63855,11 +63460,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -63885,7 +63490,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -64074,7 +63682,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Leave"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -64192,11 +63800,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -64222,7 +63830,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -64411,7 +64022,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Like"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -64529,11 +64140,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -64559,7 +64170,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -64746,7 +64360,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Listen"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -64864,11 +64478,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -64894,7 +64508,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -65039,7 +64656,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num let compactItems: unknown[]; result["type"] = "Mention"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = "https://www.w3.org/ns/activitystreams"; return result; } @@ -65058,7 +64675,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Mention"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -65165,11 +64782,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -65195,7 +64812,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -65385,7 +65005,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Move"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -65503,11 +65123,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -65533,7 +65153,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -66273,7 +65896,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -66293,7 +65916,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const item = ( - v.href + formatIri(v) ); compactItems.push(item); } @@ -66319,7 +65942,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -66337,7 +65960,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "Note"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"toot":"http://joinmastodon.org/ns#","misskey":"https://misskey-hub.net/ns#","fedibird":"http://fedibird.com/ns#","sensitive":"as:sensitive","Emoji":"toot:Emoji","Hashtag":"as:Hashtag","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"quoteUrl":"as:quoteUrl","_misskey_quote":"misskey:_misskey_quote","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; return result; } @@ -66358,7 +65981,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -66373,7 +65996,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { "@value": v.href } + { "@value": formatIri(v) } ); array.push(element);; } @@ -66392,7 +66015,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -66405,7 +66028,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#Note"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -66523,11 +66146,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -66568,11 +66191,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -66605,7 +66224,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu ) { if (v == null) continue; - const decoded = new URL(v["@value"]); + const decoded = parseIri(v["@value"]); if (typeof decoded === "undefined") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -66628,11 +66247,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -66647,7 +66262,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -67164,7 +66782,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -67183,7 +66801,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "OrderedCollection"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"toot":"http://joinmastodon.org/ns#","misskey":"https://misskey-hub.net/ns#","fedibird":"http://fedibird.com/ns#","ChatMessage":"http://litepub.social/ns#ChatMessage","sensitive":"as:sensitive","votersCount":"toot:votersCount","Emoji":"toot:Emoji","Hashtag":"as:Hashtag","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"quoteUrl":"as:quoteUrl","_misskey_quote":"misskey:_misskey_quote","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","QuoteRequest":"https://w3id.org/fep/044f#QuoteRequest","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; return result; } @@ -67204,7 +66822,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -67217,7 +66835,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#OrderedCollection"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -67335,11 +66953,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -67380,11 +66998,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -67409,7 +67023,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -67931,7 +67548,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const item = ( - v instanceof URL ? v.href : v instanceof Object ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Object ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -67966,7 +67583,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "OrderedCollectionPage"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns",{"toot":"http://joinmastodon.org/ns#","misskey":"https://misskey-hub.net/ns#","fedibird":"http://fedibird.com/ns#","ChatMessage":"http://litepub.social/ns#ChatMessage","sensitive":"as:sensitive","votersCount":"toot:votersCount","Emoji":"toot:Emoji","Hashtag":"as:Hashtag","quote":{"@id":"https://w3id.org/fep/044f#quote","@type":"@id"},"quoteUrl":"as:quoteUrl","_misskey_quote":"misskey:_misskey_quote","quoteUri":"fedibird:quoteUri","QuoteAuthorization":"https://w3id.org/fep/044f#QuoteAuthorization","QuoteRequest":"https://w3id.org/fep/044f#QuoteRequest","quoteAuthorization":{"@id":"https://w3id.org/fep/044f#quoteAuthorization","@type":"@id"},"emojiReactions":{"@id":"fedibird:emojiReactions","@type":"@id"}}]; return result; } @@ -67987,7 +67604,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Object ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -68018,7 +67635,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#OrderedCollectionPage"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -68136,11 +67753,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -68181,11 +67798,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -68228,7 +67841,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -73033,7 +72649,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73053,7 +72669,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73089,7 +72705,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73113,7 +72729,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73137,7 +72753,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73157,7 +72773,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73177,7 +72793,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73197,7 +72813,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73217,7 +72833,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73237,7 +72853,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73341,7 +72957,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73377,7 +72993,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73413,7 +73029,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -73463,7 +73079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result["type"] = "Organization"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -73502,7 +73118,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73517,7 +73133,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73547,7 +73163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73562,7 +73178,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73577,7 +73193,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73592,7 +73208,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73607,7 +73223,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73622,7 +73238,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73637,7 +73253,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73652,7 +73268,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73742,7 +73358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73757,7 +73373,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -73772,7 +73388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -73815,7 +73431,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values["@type"] = ["https://www.w3.org/ns/activitystreams#Organization"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -73943,11 +73559,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -74012,11 +73628,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74046,11 +73658,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74098,11 +73706,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74140,11 +73744,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74182,11 +73782,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74216,11 +73812,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74250,11 +73842,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74284,11 +73872,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74318,11 +73902,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74352,11 +73932,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74479,11 +74055,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74533,11 +74105,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74587,11 +74155,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -74642,7 +74206,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -75287,7 +74854,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result["type"] = "Page"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -75306,7 +74873,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Page"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -75424,11 +74991,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -75454,7 +75021,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -80217,7 +79787,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80237,7 +79807,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80273,7 +79843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80297,7 +79867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80321,7 +79891,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80341,7 +79911,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80361,7 +79931,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80381,7 +79951,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80401,7 +79971,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80421,7 +79991,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80525,7 +80095,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80561,7 +80131,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80597,7 +80167,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -80647,7 +80217,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result["type"] = "Person"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -80686,7 +80256,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80701,7 +80271,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80731,7 +80301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80746,7 +80316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80761,7 +80331,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80776,7 +80346,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80791,7 +80361,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80806,7 +80376,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80821,7 +80391,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80836,7 +80406,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80926,7 +80496,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80941,7 +80511,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -80956,7 +80526,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -80999,7 +80569,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values["@type"] = ["https://www.w3.org/ns/activitystreams#Person"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -81127,11 +80697,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -81196,11 +80766,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81230,11 +80796,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81282,11 +80844,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81324,11 +80882,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81366,11 +80920,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81400,11 +80950,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81434,11 +80980,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81468,11 +81010,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81502,11 +81040,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81536,11 +81070,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81663,11 +81193,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81717,11 +81243,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81771,11 +81293,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -81826,7 +81344,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -82808,7 +82329,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { const item = ( - v == "cm" || v == "feet" || v == "inches" || v == "km" || v == "m" || v == "miles" ? v : v.href + v == "cm" || v == "feet" || v == "inches" || v == "km" || v == "m" || v == "miles" ? v : formatIri(v) ); compactItems.push(item); } @@ -82822,7 +82343,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "Place"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -82933,7 +82454,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_oKrwxU4V8wiKhMW1QEYQibcJh8c_units) { const element = ( - v == "cm" || v == "feet" || v == "inches" || v == "km" || v == "m" || v == "miles" ? { "@value": v } : { "@id": v.href } + v == "cm" || v == "feet" || v == "inches" || v == "km" || v == "m" || v == "miles" ? { "@value": v } : { "@id": formatIri(v) } ); array.push(element);; } @@ -82946,7 +82467,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#Place"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -83064,11 +82585,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -83198,22 +82719,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu typeof v === "object" && "@value" in v && (v["@value"] == "cm" || v["@value"] == "feet" || v["@value"] == "inches" || v["@value"] == "km" || v["@value"] == "m" || v["@value"] == "miles") ? v["@value"] : v != null && typeof v === "object" && "@id" in v && typeof v["@id"] === "string" - && v["@id"] !== "" ? v["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - v["@id"].includes("/", 5) - ? v["@id"].slice(5, v["@id"].indexOf("/", 5)) - : v["@id"].slice(5) - ) + - ( - v["@id"].includes("/", 5) - ? v["@id"].slice(v["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(v["@id"]) && options.baseUrl - ? new URL(v["@id"]) - : new URL(v["@id"], options.baseUrl) : undefined + && v["@id"] !== "" ? parseIri(v["@id"], options.baseUrl) : undefined ; if (typeof decoded === "undefined") continue; _oKrwxU4V8wiKhMW1QEYQibcJh8c_units.push(decoded); @@ -83223,7 +82729,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -83779,7 +83288,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu compactItems = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -83797,7 +83306,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } result["type"] = "Profile"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -83818,7 +83327,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu array = []; for (const v of this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -83831,7 +83340,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } values["@type"] = ["https://www.w3.org/ns/activitystreams#Profile"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -83949,11 +83458,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -83994,11 +83503,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -84013,7 +83518,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -85421,7 +84929,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85436,7 +84944,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85487,7 +84995,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85502,7 +85010,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl) { const element = ( - { "@value": v.href } + { "@value": formatIri(v) } ); array.push(element);; } @@ -85521,7 +85029,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti array = []; for (const v of this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -85534,7 +85042,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } values["@type"] = ["https://www.w3.org/ns/activitystreams#Question"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -85652,11 +85160,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -85697,11 +85205,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -85731,11 +85235,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -85814,11 +85314,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -85851,7 +85347,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti ) { if (v == null) continue; - const decoded = new URL(v["@value"]); + const decoded = parseIri(v["@value"]); if (typeof decoded === "undefined") continue; _K1zrMQkQjmciFAmGdGLfaDbG925_quoteUrl.push(decoded); } @@ -85874,11 +85370,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -85893,7 +85385,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -86225,7 +85720,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Read"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -86343,11 +85838,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -86373,7 +85868,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -86562,7 +86060,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Reject"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -86680,11 +86178,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -86714,7 +86212,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -87994,7 +87495,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88014,7 +87515,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88034,7 +87535,7 @@ relationships?: (Object | URL)[];} compactItems = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -88052,7 +87553,7 @@ relationships?: (Object | URL)[];} } result["type"] = "Relationship"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -88073,7 +87574,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88088,7 +87589,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88103,7 +87604,7 @@ relationships?: (Object | URL)[];} array = []; for (const v of this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -88116,7 +87617,7 @@ relationships?: (Object | URL)[];} } values["@type"] = ["https://www.w3.org/ns/activitystreams#Relationship"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -88234,11 +87735,11 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -88279,11 +87780,7 @@ relationships?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -88313,11 +87810,7 @@ relationships?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -88347,11 +87840,7 @@ relationships?: (Object | URL)[];} if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -88366,7 +87855,10 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -88627,7 +88119,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Remove"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -88745,11 +88237,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -88775,7 +88267,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -93538,7 +93033,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93558,7 +93053,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93594,7 +93089,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93618,7 +93113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const item = ( - v instanceof URL ? v.href : v instanceof OrderedCollection ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof OrderedCollection ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93642,7 +93137,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93662,7 +93157,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93682,7 +93177,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93702,7 +93197,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93722,7 +93217,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93742,7 +93237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93846,7 +93341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93882,7 +93377,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const item = ( - v instanceof URL ? v.href : v instanceof Application ? await v.toJsonLd({ + v instanceof URL ? formatIri(v) : v instanceof Application ? await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93918,7 +93413,7 @@ get preferredUsernames(): ((string | LanguageString))[] { compactItems = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const item = ( - v instanceof URL ? v.href : await v.toJsonLd({ + v instanceof URL ? formatIri(v) : await v.toJsonLd({ ...(options), format: undefined, context: undefined, @@ -93968,7 +93463,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } result["type"] = "Service"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1","https://w3id.org/security/data-integrity/v1","https://www.w3.org/ns/did/v1","https://w3id.org/security/multikey/v1","https://gotosocial.org/ns",{"alsoKnownAs":{"@id":"as:alsoKnownAs","@type":"@id"},"manuallyApprovesFollowers":"as:manuallyApprovesFollowers","movedTo":{"@id":"as:movedTo","@type":"@id"},"toot":"http://joinmastodon.org/ns#","Emoji":"toot:Emoji","featured":{"@id":"toot:featured","@type":"@id"},"featuredTags":{"@id":"toot:featuredTags","@type":"@id"},"discoverable":"toot:discoverable","suspended":"toot:suspended","memorial":"toot:memorial","indexable":"toot:indexable","schema":"http://schema.org#","PropertyValue":"schema:PropertyValue","value":"schema:value","misskey":"https://misskey-hub.net/ns#","_misskey_followedMessage":"misskey:_misskey_followedMessage","isCat":"misskey:isCat"}]; return result; } @@ -94007,7 +93502,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94022,7 +93517,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94052,7 +93547,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94067,7 +93562,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof OrderedCollection ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94082,7 +93577,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94097,7 +93592,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94112,7 +93607,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94127,7 +93622,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94142,7 +93637,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94157,7 +93652,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94247,7 +93742,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94262,7 +93757,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs) { const element = ( - v instanceof URL ? { "@id": v.href } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : v instanceof Application ? await v.toJsonLd(options) : v instanceof Group ? await v.toJsonLd(options) : v instanceof Organization ? await v.toJsonLd(options) : v instanceof Person ? await v.toJsonLd(options) : await v.toJsonLd(options) ); array.push(element);; } @@ -94277,7 +93772,7 @@ get preferredUsernames(): ((string | LanguageString))[] { array = []; for (const v of this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service) { const element = ( - v instanceof URL ? { "@id": v.href } : await v.toJsonLd(options) + v instanceof URL ? { "@id": formatIri(v) } : await v.toJsonLd(options) ); array.push(element);; } @@ -94320,7 +93815,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } values["@type"] = ["https://www.w3.org/ns/activitystreams#Service"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -94448,11 +93943,11 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -94517,11 +94012,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _axq166E2eZADq34V4MYUc8KMZdC_publicKey.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94551,11 +94042,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94603,11 +94090,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94645,11 +94128,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _41QwhqJouoLg3h8dRPKat21brynC_outbox.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _41QwhqJouoLg3h8dRPKat21brynC_outbox.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94687,11 +94166,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94721,11 +94196,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _BBCTgfphhsFzpVfKTykGSpBNwoA_followers.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94755,11 +94226,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94789,11 +94256,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4N1vBJzXDf8NbBumeECQMFvKetja_featured.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94823,11 +94286,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94857,11 +94316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -94984,11 +94439,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -95038,11 +94489,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -95092,11 +94539,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push( - !URL.canParse(v["@id"], options.baseUrl) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], options.baseUrl) - ); + _4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.push(parseIri(v["@id"], options.baseUrl)); continue; } @@ -95147,7 +94590,10 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -95991,7 +95437,7 @@ get contents(): ((string | LanguageString))[] { } - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = "https://www.w3.org/ns/activitystreams"; return result; } @@ -96033,7 +95479,7 @@ get contents(): ((string | LanguageString))[] { } - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -96145,11 +95591,11 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -96164,7 +95610,7 @@ get contents(): ((string | LanguageString))[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; @@ -96212,7 +95658,10 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -96462,7 +95911,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#TentativeAccept"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -96580,11 +96029,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -96610,7 +96059,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -96799,7 +96251,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#TentativeReject"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -96917,11 +96369,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -96947,7 +96399,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -97295,7 +96750,7 @@ get formerTypes(): ($EntityType)[] { } result["type"] = "Tombstone"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -97347,7 +96802,7 @@ get formerTypes(): ($EntityType)[] { } values["@type"] = ["https://www.w3.org/ns/activitystreams#Tombstone"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -97470,11 +96925,11 @@ get formerTypes(): ($EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -97553,7 +97008,10 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -97790,7 +97248,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Travel"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -97908,11 +97366,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -97938,7 +97396,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -98132,7 +97593,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Undo"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -98250,11 +97711,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -98280,7 +97741,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -98472,7 +97936,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Update"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -98590,11 +98054,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -98620,7 +98084,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -98793,7 +98260,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let compactItems: unknown[]; result["type"] = "Video"; - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ["https://www.w3.org/ns/activitystreams","https://w3id.org/security/data-integrity/v1","https://gotosocial.org/ns"]; return result; } @@ -98812,7 +98279,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu >; values["@type"] = ["https://www.w3.org/ns/activitystreams#Video"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -98930,11 +98397,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -98960,7 +98427,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", @@ -99148,7 +98618,7 @@ instruments?: (Object | URL)[];} >; values["@type"] = ["https://www.w3.org/ns/activitystreams#View"]; - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -99266,11 +98736,11 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } if ("@type" in values) { @@ -99296,7 +98766,10 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index d1943554e..030671444 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -180,17 +180,20 @@ export async function* generateClasses( validateTypeSchemas(types); const runtimeImports = [ "canParseDecimal", + "canParseIri", "decodeMultibase", "type Decimal", "type DocumentLoader", "encodeMultibase", "exportMultibaseKey", "exportSpki", + "formatIri", "getDocumentLoader", "importMultibaseKey", "importPem", "isDecimal", "LanguageString", + "parseIri", "parseDecimal", "type RemoteDocument", ]; diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 260f5961c..d133a5114 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -127,7 +127,7 @@ export async function* generateEncoder( const item = ( `; if (!areAllScalarTypes(property.range, types)) { - yield "v instanceof URL ? v.href : "; + yield "v instanceof URL ? formatIri(v) : "; } const encoders = getEncoders( property.range, @@ -178,7 +178,7 @@ export async function* generateEncoder( ? "" : `result["type"] = ${JSON.stringify(type.compactName ?? type.uri)};` } - if (this.id != null) result["id"] = this.id.href; + if (this.id != null) result["id"] = formatIri(this.id); result["@context"] = ${JSON.stringify(type.defaultContext)}; return result; } @@ -210,7 +210,7 @@ export async function* generateEncoder( const element = ( `; if (!areAllScalarTypes(property.range, types)) { - yield 'v instanceof URL ? { "@id": v.href } : '; + yield 'v instanceof URL ? { "@id": formatIri(v) } : '; } for (const code of getEncoders(property.range, types, "v", "options")) { yield code; @@ -250,7 +250,7 @@ export async function* generateEncoder( } yield ` ${type.typeless ? "" : `values["@type"] = [${JSON.stringify(type.uri)}];`} - if (this.id != null) values["@id"] = this.id.href; + if (this.id != null) values["@id"] = formatIri(this.id); if (options.format === "expand") { return await jsonld.expand( values, @@ -404,11 +404,11 @@ export async function* generateDecoder( // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !URL.canParse(values["@id"], options.baseUrl)) { + if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"])) { - options = { ...options, baseUrl: new URL(values["@id"]) }; + if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + options = { ...options, baseUrl: parseIri(values["@id"]) }; } `; const subtypes = getSubtypes(typeUri, types, true); @@ -435,7 +435,7 @@ export async function* generateDecoder( if (type.extends == null) { yield ` const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && URL.canParse(values["@id"], options.baseUrl) ? new URL(values["@id"], options.baseUrl) : undefined }, + { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, ); `; @@ -491,11 +491,7 @@ export async function* generateDecoder( if (typeof v === "object" && "@id" in v && !("@type" in v) && globalThis.Object.keys(v).length === 1) { if (v["@id"].startsWith("_:")) continue; - ${variable}.push( - !URL.canParse(v["@id"], ${propertyBaseUrl}) && v["@id"].startsWith("at://") - ? new URL("at://" + encodeURIComponent(v["@id"].substring(5))) - : new URL(v["@id"], ${propertyBaseUrl}) - ); + ${variable}.push(parseIri(v["@id"], ${propertyBaseUrl})); continue; } `; @@ -539,7 +535,10 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - instance._cachedJsonLd = structuredClone(json); + const jsonText = JSON.stringify(json); + if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + instance._cachedJsonLd = structuredClone(json); + } } catch { getLogger(["fedify", "vocab"]).warn( "Failed to cache JSON-LD: {json}", diff --git a/packages/vocab-tools/src/type.ts b/packages/vocab-tools/src/type.ts index 4adc1e7cc..086d75be1 100644 --- a/packages/vocab-tools/src/type.ts +++ b/packages/vocab-tools/src/type.ts @@ -157,10 +157,10 @@ const scalarTypes: Record = { return `${v} instanceof URL`; }, encoder(v) { - return `{ "@id": ${v}.href }`; + return `{ "@id": formatIri(${v}) }`; }, compactEncoder(v) { - return `${v}.href`; + return `formatIri(${v})`; }, dataCheck(v) { return `${v} != null && typeof ${v} === "object" && "@id" in ${v} @@ -168,22 +168,7 @@ const scalarTypes: Record = { && ${v}["@id"] !== ""`; }, decoder(v, baseUrlVar) { - return `${v}["@id"].startsWith("at://") - ? new URL("at://" + - encodeURIComponent( - ${v}["@id"].includes("/", 5) - ? ${v}["@id"].slice(5, ${v}["@id"].indexOf("/", 5)) - : ${v}["@id"].slice(5) - ) + - ( - ${v}["@id"].includes("/", 5) - ? ${v}["@id"].slice(${v}["@id"].indexOf("/", 5)) - : "" - ) - ) - : URL.canParse(${v}["@id"]) && ${baseUrlVar} - ? new URL(${v}["@id"]) - : new URL(${v}["@id"], ${baseUrlVar})`; + return `parseIri(${v}["@id"], ${baseUrlVar})`; }, }, "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString": { @@ -325,10 +310,10 @@ const scalarTypes: Record = { return `${v} instanceof URL`; }, encoder(v) { - return `{ "@value": ${v}.href }`; + return `{ "@value": formatIri(${v}) }`; }, compactEncoder(v) { - return `${v}.href`; + return `formatIri(${v})`; }, dataCheck(v) { return `typeof ${v} === "object" && "@value" in ${v} @@ -336,7 +321,7 @@ const scalarTypes: Record = { && ${v}["@value"] !== "" && ${v}["@value"] !== "/"`; }, decoder(v) { - return `new URL(${v}["@value"])`; + return `parseIri(${v}["@value"])`; }, }, "fedify:publicKey": { diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index f6cc82e5e..82c9a6ad4 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -479,6 +479,126 @@ test("Activity.fromJsonLd()", async () => { ); }); +test("fromJsonLd() handles portable ActivityPub IRIs", async () => { + const did = "did:key:z6Mkabc"; + const portableActor = + `ap://${did}/actor?gateways=https%3A%2F%2Fserver.example`; + const portableObject = + `ap://${did}/objects/1?gateways=https%3A%2F%2Fserver.example`; + const uppercasePortableObject = + `AP://${did}/objects/1?gateways=https%3A%2F%2Fserver.example`; + const portablePage = `ap://${did}/actor/outbox?page=2`; + + const note = await Note.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: uppercasePortableObject, + attributedTo: `ap+ef61://${ + encodeURIComponent(did) + }/actor?gateways=https%3A%2F%2Fserver.example`, + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + deepStrictEqual( + note.id, + new URL( + "ap+ef61://did%3Akey%3Az6Mkabc/objects/1?gateways=https%3A%2F%2Fserver.example", + ), + ); + deepStrictEqual( + note.attributionId, + new URL( + "ap+ef61://did%3Akey%3Az6Mkabc/actor?gateways=https%3A%2F%2Fserver.example", + ), + ); + const noteJson = await note.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual(noteJson.type, "Note"); + deepStrictEqual( + noteJson.id, + "ap+ef61://did:key:z6Mkabc/objects/1?gateways=https%3A%2F%2Fserver.example", + ); + deepStrictEqual( + noteJson.attributedTo, + "ap+ef61://did:key:z6Mkabc/actor?gateways=https%3A%2F%2Fserver.example", + ); + + const activity = await Activity.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + actor: portableActor, + object: portableObject, + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + deepStrictEqual( + activity.actorId, + new URL( + "ap+ef61://did%3Akey%3Az6Mkabc/actor?gateways=https%3A%2F%2Fserver.example", + ), + ); + const activityJson = await activity.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual(activityJson.type, "Create"); + deepStrictEqual( + activityJson.actor, + "ap+ef61://did:key:z6Mkabc/actor?gateways=https%3A%2F%2Fserver.example", + ); + deepStrictEqual( + activityJson.object, + "ap+ef61://did:key:z6Mkabc/objects/1?gateways=https%3A%2F%2Fserver.example", + ); + + const person = await Person.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + type: "Person", + inbox: `ap+ef61://${did}/actor/inbox`, + outbox: `ap+ef61://${did}/actor/outbox`, + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + deepStrictEqual( + person.inboxId, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor/inbox"), + ); + deepStrictEqual( + person.outboxId, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor/outbox"), + ); + const personJson = await person.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual(personJson.type, "Person"); + deepStrictEqual(personJson.inbox, "ap+ef61://did:key:z6Mkabc/actor/inbox"); + deepStrictEqual( + personJson.outbox, + "ap+ef61://did:key:z6Mkabc/actor/outbox", + ); + + const page = await OrderedCollectionPage.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + type: "OrderedCollectionPage", + next: portablePage, + prev: `ap+ef61://${encodeURIComponent(did)}/actor/outbox?page=1`, + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + deepStrictEqual( + page.nextId, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor/outbox?page=2"), + ); + deepStrictEqual( + page.prevId, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor/outbox?page=1"), + ); + const pageJson = await page.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual(pageJson.type, "OrderedCollectionPage"); + deepStrictEqual( + pageJson.next, + "ap+ef61://did:key:z6Mkabc/actor/outbox?page=2", + ); + deepStrictEqual( + pageJson.prev, + "ap+ef61://did:key:z6Mkabc/actor/outbox?page=1", + ); +}); + test({ name: "Activity.getObject()", permissions: { env: true, read: true }, From 472a18a756798b1b0dba71a93b8ad0b8985cc97c Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 14:44:32 +0900 Subject: [PATCH 02/55] Document portable IRI codec support The vocabulary manual and changelog now describe how generated vocab codecs accept FEP-ef61 portable IRIs and format them in JSON-LD output. https://github.com/fedify-dev/fedify/issues/826 Assisted-by: Codex:gpt-5.5 --- CHANGES.md | 10 ++++++++++ docs/manual/vocab.md | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 679cf4860..f995b70cd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,16 @@ Version 2.4.0 To be released. +### @fedify/vocab + + - Added support for FEP-ef61 portable ActivityPub IRIs in generated + vocabulary codecs. `ap:` and `ap+ef61:` values with decoded or + percent-encoded DID authorities now parse as `URL` objects, and JSON-LD + serialization emits canonical `ap+ef61:` values with decoded DID + authorities. [[#826]] + +[#826]: https://github.com/fedify-dev/fedify/issues/826 + Version 2.3.1 ------------- diff --git a/docs/manual/vocab.md b/docs/manual/vocab.md index 26bd8c661..c5899c3d2 100644 --- a/docs/manual/vocab.md +++ b/docs/manual/vocab.md @@ -108,12 +108,19 @@ const create = new Create({ Note that every URI is represented as a [`URL`] object. This is for distinguishing the URIs from the other strings. +Fedify also accepts [FEP-ef61] portable ActivityPub IRIs in JSON-LD input. +Both the `ap:` and `ap+ef61:` schemes are accepted, whether the DID authority +is decoded (e.g., `ap+ef61://did:key:.../actor`) or percent-encoded. Fedify +stores these IRIs as `URL` objects with a URL-safe authority internally, and +serializes them as canonical `ap+ef61:` IRIs with the decoded DID authority. + > [!TIP] > You can instantiate an object from a JSON-LD document by calling the > `fromJsonLd()` method of the object. See the [*JSON-LD* section](#json-ld) > for details. [`URL`]: https://developer.mozilla.org/en-US/docs/Web/API/URL +[FEP-ef61]: https://w3id.org/fep/ef61 Properties From b5187bc76d2661f7859e364c82152ba6286b7df2 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 22:12:03 +0900 Subject: [PATCH 03/55] Reuse portable IRI regex patterns Portable IRI parsing and generated JSON-LD cache checks now use module-level regular expression constants instead of recreating regex objects at each call site. https://github.com/fedify-dev/fedify/issues/826 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.ts | 7 +- .../src/__snapshots__/class.test.ts.deno.snap | 164 +++++++++--------- .../src/__snapshots__/class.test.ts.node.snap | 164 +++++++++--------- .../src/__snapshots__/class.test.ts.snap | 164 +++++++++--------- packages/vocab-tools/src/class.ts | 1 + packages/vocab-tools/src/codec.ts | 2 +- 6 files changed, 255 insertions(+), 247 deletions(-) diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index b5db7649a..8c11754ac 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -9,6 +9,9 @@ export class UrlError extends Error { } } +const PORTABLE_IRI_PATTERN = + /^(ap|ap\+ef61):\/\/([^/?#]*)([^?#]*)(\?[^#]*)?(#.*)?$/i; + /** * Checks whether the given string can be parsed as an IRI. */ @@ -47,9 +50,7 @@ export function formatIri(iri: string | URL): string { } function parsePortableIri(iri: string): URL | null { - const match = iri.match( - /^(ap|ap\+ef61):\/\/([^/?#]*)([^?#]*)(\?[^#]*)?(#.*)?$/i, - ); + const match = iri.match(PORTABLE_IRI_PATTERN); if (match == null) return null; const authority = decodePortableAuthority(match[2]); if (!authority.startsWith("did:")) { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 33a330389..0d2eda65f 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -31,6 +31,8 @@ import { } from \\"@fedify/vocab-runtime/temporal\\"; +const PORTABLE_IRI_PATTERN = /ap(?:\\\\+ef61)?:\\\\/\\\\//i; + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12015,7 +12017,7 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13217,7 +13219,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14329,7 +14331,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17720,7 +17722,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18215,7 +18217,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18774,7 +18776,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19361,7 +19363,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20409,7 +20411,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20798,7 +20800,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21481,7 +21483,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22194,7 +22196,7 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23253,7 +23255,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23641,7 +23643,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24633,7 +24635,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25021,7 +25023,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26012,7 +26014,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26400,7 +26402,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26875,7 +26877,7 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27202,7 +27204,7 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28134,7 +28136,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29082,7 +29084,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29981,7 +29983,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30589,7 +30591,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31173,7 +31175,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32049,7 +32051,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32896,7 +32898,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33321,7 +33323,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33663,7 +33665,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -34004,7 +34006,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40327,7 +40329,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41152,7 +41154,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41493,7 +41495,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42600,7 +42602,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43207,7 +43209,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43590,7 +43592,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43934,7 +43936,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44276,7 +44278,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48613,7 +48615,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50185,7 +50187,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50583,7 +50585,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50923,7 +50925,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51261,7 +51263,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52171,7 +52173,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52649,7 +52651,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52990,7 +52992,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53332,7 +53334,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59655,7 +59657,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61627,7 +61629,7 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62123,7 +62125,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62466,7 +62468,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62811,7 +62813,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63151,7 +63153,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63491,7 +63493,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63831,7 +63833,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64171,7 +64173,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64509,7 +64511,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64813,7 +64815,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65154,7 +65156,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66263,7 +66265,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67024,7 +67026,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67842,7 +67844,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74207,7 +74209,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -75022,7 +75024,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81345,7 +81347,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82730,7 +82732,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83519,7 +83521,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85386,7 +85388,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85869,7 +85871,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86213,7 +86215,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87856,7 +87858,7 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88268,7 +88270,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94591,7 +94593,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95659,7 +95661,7 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96060,7 +96062,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96400,7 +96402,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97009,7 +97011,7 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97397,7 +97399,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97742,7 +97744,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98085,7 +98087,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98428,7 +98430,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98767,7 +98769,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index aeb820fea..b9556e611 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -29,6 +29,8 @@ import { } from \\"@fedify/vocab-runtime/temporal\\"; +const PORTABLE_IRI_PATTERN = /ap(?:\\\\+ef61)?:\\\\/\\\\//i; + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12013,7 +12015,7 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13215,7 +13217,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14327,7 +14329,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17718,7 +17720,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18213,7 +18215,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18772,7 +18774,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19359,7 +19361,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20407,7 +20409,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20796,7 +20798,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21479,7 +21481,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22192,7 +22194,7 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23251,7 +23253,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23639,7 +23641,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24631,7 +24633,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25019,7 +25021,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26010,7 +26012,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26398,7 +26400,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26873,7 +26875,7 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27200,7 +27202,7 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28132,7 +28134,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29080,7 +29082,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29979,7 +29981,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30587,7 +30589,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31171,7 +31173,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32047,7 +32049,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32894,7 +32896,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33319,7 +33321,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33661,7 +33663,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -34002,7 +34004,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40325,7 +40327,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41150,7 +41152,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41491,7 +41493,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42598,7 +42600,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43205,7 +43207,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43588,7 +43590,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43932,7 +43934,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44274,7 +44276,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48611,7 +48613,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50183,7 +50185,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50581,7 +50583,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50921,7 +50923,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51259,7 +51261,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52169,7 +52171,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52647,7 +52649,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52988,7 +52990,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53330,7 +53332,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59653,7 +59655,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61625,7 +61627,7 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62121,7 +62123,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62464,7 +62466,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62809,7 +62811,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63149,7 +63151,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63489,7 +63491,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63829,7 +63831,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64169,7 +64171,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64507,7 +64509,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64811,7 +64813,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65152,7 +65154,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66261,7 +66263,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67022,7 +67024,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67840,7 +67842,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74205,7 +74207,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -75020,7 +75022,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81343,7 +81345,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82728,7 +82730,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83517,7 +83519,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85384,7 +85386,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85867,7 +85869,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86211,7 +86213,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87854,7 +87856,7 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88266,7 +88268,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94589,7 +94591,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95657,7 +95659,7 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96058,7 +96060,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96398,7 +96400,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97007,7 +97009,7 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97395,7 +97397,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97740,7 +97742,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98083,7 +98085,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98426,7 +98428,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98765,7 +98767,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\\\+ef61)?:\\\\/\\\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index b18685c3f..835a504db 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -31,6 +31,8 @@ import { } from "@fedify/vocab-runtime/temporal"; +const PORTABLE_IRI_PATTERN = /ap(?:\\+ef61)?:\\/\\//i; + import * as _ppM0 from "./preprocessors.ts"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12015,7 +12017,7 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13217,7 +13219,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14329,7 +14331,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17720,7 +17722,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18215,7 +18217,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18774,7 +18776,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19361,7 +19363,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20409,7 +20411,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20798,7 +20800,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21481,7 +21483,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22194,7 +22196,7 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23253,7 +23255,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23641,7 +23643,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24633,7 +24635,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25021,7 +25023,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26012,7 +26014,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26400,7 +26402,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26875,7 +26877,7 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27202,7 +27204,7 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28134,7 +28136,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29082,7 +29084,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29981,7 +29983,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30589,7 +30591,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31173,7 +31175,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32049,7 +32051,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32896,7 +32898,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33321,7 +33323,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33663,7 +33665,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -34004,7 +34006,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40327,7 +40329,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41152,7 +41154,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41493,7 +41495,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42600,7 +42602,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43207,7 +43209,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43590,7 +43592,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43934,7 +43936,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44276,7 +44278,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48613,7 +48615,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50185,7 +50187,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50583,7 +50585,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50923,7 +50925,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51261,7 +51263,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52171,7 +52173,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52649,7 +52651,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52990,7 +52992,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53332,7 +53334,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59655,7 +59657,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61627,7 +61629,7 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62123,7 +62125,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62466,7 +62468,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62811,7 +62813,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63151,7 +63153,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63491,7 +63493,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63831,7 +63833,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64171,7 +64173,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64509,7 +64511,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64813,7 +64815,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65154,7 +65156,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66263,7 +66265,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67024,7 +67026,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67842,7 +67844,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74207,7 +74209,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -75022,7 +75024,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81345,7 +81347,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82730,7 +82732,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83519,7 +83521,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85386,7 +85388,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85869,7 +85871,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86213,7 +86215,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87856,7 +87858,7 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88268,7 +88270,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94591,7 +94593,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95659,7 +95661,7 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96060,7 +96062,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96400,7 +96402,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97009,7 +97011,7 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97397,7 +97399,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97742,7 +97744,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98085,7 +98087,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98428,7 +98430,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98767,7 +98769,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 030671444..f8bd92c01 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -210,6 +210,7 @@ export async function* generateClasses( isTemporalInstant, } from "@fedify/vocab-runtime/temporal";\n`; yield "\n\n"; + yield "const PORTABLE_IRI_PATTERN = /ap(?:\\+ef61)?:\\/\\//i;\n\n"; const moduleVarNames = new Map(); const sorted = sortTopologically(types); for (const typeUri of sorted) { diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index d133a5114..1ab749ca0 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -536,7 +536,7 @@ export async function* generateDecoder( if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const jsonText = JSON.stringify(json); - if (jsonText == null || !/ap(?:\\+ef61)?:\\/\\//i.test(jsonText)) { + if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { instance._cachedJsonLd = structuredClone(json); } } catch { From 609d8e497e8a402254c2c93b60714f928a435fb0 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 22:15:02 +0900 Subject: [PATCH 04/55] Add FEP/PR links to the changelog --- CHANGES.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f995b70cd..8bd936766 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,13 +10,15 @@ To be released. ### @fedify/vocab - - Added support for FEP-ef61 portable ActivityPub IRIs in generated + - Added support for [FEP-ef61] portable ActivityPub IRIs in generated vocabulary codecs. `ap:` and `ap+ef61:` values with decoded or percent-encoded DID authorities now parse as `URL` objects, and JSON-LD serialization emits canonical `ap+ef61:` values with decoded DID - authorities. [[#826]] + authorities. [[#826], [#850]] +[FEP-ef61]: https://w3id.org/fep/ef61 [#826]: https://github.com/fedify-dev/fedify/issues/826 +[#850]: https://github.com/fedify-dev/fedify/pull/850 Version 2.3.1 From 6ad8269479c48e37f039dd70a7a958cfcfd64229 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 22:38:00 +0900 Subject: [PATCH 05/55] Narrow portable IRI cache detection Generated codecs now look for portable ActivityPub IRIs only in ID-valued JSON-LD positions before deciding whether to bypass the raw JSON-LD cache. This keeps ordinary text such as post content from causing cache misses and dropping extension properties on default serialization. https://github.com/fedify-dev/fedify/pull/850#discussion_r3492000741 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492028682 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 261 +++++++----------- .../src/__snapshots__/class.test.ts.node.snap | 261 +++++++----------- .../src/__snapshots__/class.test.ts.snap | 261 +++++++----------- packages/vocab-tools/src/class.ts | 60 +++- packages/vocab-tools/src/codec.ts | 3 +- packages/vocab/src/vocab.test.ts | 20 ++ 6 files changed, 373 insertions(+), 493 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 0d2eda65f..a14ff2177 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -31,7 +31,23 @@ import { } from \\"@fedify/vocab-runtime/temporal\\"; -const PORTABLE_IRI_PATTERN = /ap(?:\\\\+ef61)?:\\\\/\\\\//i; +const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; +const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); + +function hasPortableIri(value: unknown, key?: string): boolean { + if (typeof value === \\"string\\") { + return key != null && PORTABLE_IRI_KEYS.has(key) && + PORTABLE_IRI_PATTERN.test(value); + } + if (Array.isArray(value)) { + return value.some((item) => hasPortableIri(item, key)); + } + if (value == null || typeof value !== \\"object\\") return false; + const object = value as Record; + return globalThis.Object.keys(object).some((entryKey) => + hasPortableIri(object[entryKey], entryKey) + ); +} import * as _ppM0 from \\"./preprocessors.ts\\"; @@ -12016,8 +12032,7 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13218,8 +13233,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14330,8 +14344,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17721,8 +17734,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18216,8 +18228,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18775,8 +18786,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19362,8 +19372,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20410,8 +20419,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20799,8 +20807,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21482,8 +21489,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22195,8 +22201,7 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23254,8 +23259,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23642,8 +23646,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24634,8 +24637,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25022,8 +25024,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26013,8 +26014,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26401,8 +26401,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26876,8 +26875,7 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27203,8 +27201,7 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28135,8 +28132,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29083,8 +29079,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29982,8 +29977,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30590,8 +30584,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31174,8 +31167,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32050,8 +32042,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32897,8 +32888,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33322,8 +33312,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33664,8 +33653,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -34005,8 +33993,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40328,8 +40315,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41153,8 +41139,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41494,8 +41479,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42601,8 +42585,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43208,8 +43191,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43591,8 +43573,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43935,8 +43916,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44277,8 +44257,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48614,8 +48593,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50186,8 +50164,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50584,8 +50561,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50924,8 +50900,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51262,8 +51237,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52172,8 +52146,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52650,8 +52623,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52991,8 +52963,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53333,8 +53304,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59656,8 +59626,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61628,8 +61597,7 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62124,8 +62092,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62467,8 +62434,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62812,8 +62778,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63152,8 +63117,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63492,8 +63456,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63832,8 +63795,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64172,8 +64134,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64510,8 +64471,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64814,8 +64774,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65155,8 +65114,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66264,8 +66222,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67025,8 +66982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67843,8 +67799,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74208,8 +74163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -75023,8 +74977,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81346,8 +81299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82731,8 +82683,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83520,8 +83471,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85387,8 +85337,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85870,8 +85819,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86214,8 +86162,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87857,8 +87804,7 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88269,8 +88215,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94592,8 +94537,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95660,8 +95604,7 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96061,8 +96004,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96401,8 +96343,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97010,8 +96951,7 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97398,8 +97338,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97743,8 +97682,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98086,8 +98024,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98429,8 +98366,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98768,8 +98704,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index b9556e611..3ba7d4af8 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -29,7 +29,23 @@ import { } from \\"@fedify/vocab-runtime/temporal\\"; -const PORTABLE_IRI_PATTERN = /ap(?:\\\\+ef61)?:\\\\/\\\\//i; +const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; +const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); + +function hasPortableIri(value: unknown, key?: string): boolean { + if (typeof value === \\"string\\") { + return key != null && PORTABLE_IRI_KEYS.has(key) && + PORTABLE_IRI_PATTERN.test(value); + } + if (Array.isArray(value)) { + return value.some((item) => hasPortableIri(item, key)); + } + if (value == null || typeof value !== \\"object\\") return false; + const object = value as Record; + return globalThis.Object.keys(object).some((entryKey) => + hasPortableIri(object[entryKey], entryKey) + ); +} import * as _ppM0 from \\"./preprocessors.ts\\"; @@ -12014,8 +12030,7 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13216,8 +13231,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14328,8 +14342,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17719,8 +17732,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18214,8 +18226,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18773,8 +18784,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19360,8 +19370,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20408,8 +20417,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20797,8 +20805,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21480,8 +21487,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22193,8 +22199,7 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23252,8 +23257,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23640,8 +23644,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24632,8 +24635,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25020,8 +25022,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26011,8 +26012,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26399,8 +26399,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26874,8 +26873,7 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27201,8 +27199,7 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28133,8 +28130,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29081,8 +29077,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29980,8 +29975,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30588,8 +30582,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31172,8 +31165,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32048,8 +32040,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32895,8 +32886,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33320,8 +33310,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33662,8 +33651,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -34003,8 +33991,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40326,8 +40313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41151,8 +41137,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41492,8 +41477,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42599,8 +42583,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43206,8 +43189,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43589,8 +43571,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43933,8 +43914,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44275,8 +44255,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48612,8 +48591,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50184,8 +50162,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50582,8 +50559,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50922,8 +50898,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51260,8 +51235,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52170,8 +52144,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52648,8 +52621,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52989,8 +52961,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53331,8 +53302,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59654,8 +59624,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61626,8 +61595,7 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62122,8 +62090,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62465,8 +62432,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62810,8 +62776,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63150,8 +63115,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63490,8 +63454,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63830,8 +63793,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64170,8 +64132,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64508,8 +64469,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64812,8 +64772,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65153,8 +65112,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66262,8 +66220,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67023,8 +66980,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67841,8 +67797,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74206,8 +74161,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -75021,8 +74975,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81344,8 +81297,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82729,8 +82681,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83518,8 +83469,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85385,8 +85335,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85868,8 +85817,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86212,8 +86160,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87855,8 +87802,7 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88267,8 +88213,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94590,8 +94535,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95658,8 +95602,7 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96059,8 +96002,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96399,8 +96341,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97008,8 +96949,7 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97396,8 +97336,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97741,8 +97680,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98084,8 +98022,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98427,8 +98364,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98766,8 +98702,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 835a504db..9c66f3bec 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -31,7 +31,23 @@ import { } from "@fedify/vocab-runtime/temporal"; -const PORTABLE_IRI_PATTERN = /ap(?:\\+ef61)?:\\/\\//i; +const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; +const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); + +function hasPortableIri(value: unknown, key?: string): boolean { + if (typeof value === "string") { + return key != null && PORTABLE_IRI_KEYS.has(key) && + PORTABLE_IRI_PATTERN.test(value); + } + if (Array.isArray(value)) { + return value.some((item) => hasPortableIri(item, key)); + } + if (value == null || typeof value !== "object") return false; + const object = value as Record; + return globalThis.Object.keys(object).some((entryKey) => + hasPortableIri(object[entryKey], entryKey) + ); +} import * as _ppM0 from "./preprocessors.ts"; @@ -12016,8 +12032,7 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13218,8 +13233,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14330,8 +14344,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17721,8 +17734,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18216,8 +18228,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18775,8 +18786,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19362,8 +19372,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20410,8 +20419,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20799,8 +20807,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21482,8 +21489,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22195,8 +22201,7 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23254,8 +23259,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23642,8 +23646,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24634,8 +24637,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25022,8 +25024,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26013,8 +26014,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26401,8 +26401,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26876,8 +26875,7 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27203,8 +27201,7 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28135,8 +28132,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29083,8 +29079,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29982,8 +29977,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30590,8 +30584,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31174,8 +31167,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32050,8 +32042,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32897,8 +32888,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33322,8 +33312,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33664,8 +33653,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -34005,8 +33993,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40328,8 +40315,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41153,8 +41139,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41494,8 +41479,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42601,8 +42585,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43208,8 +43191,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43591,8 +43573,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43935,8 +43916,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44277,8 +44257,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48614,8 +48593,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50186,8 +50164,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50584,8 +50561,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50924,8 +50900,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51262,8 +51237,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52172,8 +52146,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52650,8 +52623,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52991,8 +52963,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53333,8 +53304,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59656,8 +59626,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61628,8 +61597,7 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62124,8 +62092,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62467,8 +62434,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62812,8 +62778,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63152,8 +63117,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63492,8 +63456,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63832,8 +63795,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64172,8 +64134,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64510,8 +64471,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64814,8 +64774,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65155,8 +65114,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66264,8 +66222,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67025,8 +66982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67843,8 +67799,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74208,8 +74163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -75023,8 +74977,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81346,8 +81299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82731,8 +82683,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83520,8 +83471,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85387,8 +85337,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85870,8 +85819,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86214,8 +86162,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87857,8 +87804,7 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88269,8 +88215,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94592,8 +94537,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95660,8 +95604,7 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96061,8 +96004,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96401,8 +96343,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97010,8 +96951,7 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97398,8 +97338,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97743,8 +97682,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98086,8 +98024,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98429,8 +98366,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98768,8 +98704,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index f8bd92c01..dc53b3015 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -3,9 +3,15 @@ import { generateCloner, generateConstructor } from "./constructor.ts"; import { generateFields } from "./field.ts"; import { generateInspector, generateInspectorPostClass } from "./inspector.ts"; import { generateProperties } from "./property.ts"; -import { type TypeSchema, validateTypeSchemas } from "./schema.ts"; +import { + type PropertySchema, + type TypeSchema, + validateTypeSchemas, +} from "./schema.ts"; import { emitOverride } from "./type.ts"; +const XSD_ANY_URI = "http://www.w3.org/2001/XMLSchema#anyURI"; + /** * Sorts the given types topologically so that the base types come before the * extended types. @@ -169,6 +175,33 @@ export function getEntityTypeById(id: string | URL): $EntityType | undefined { `; } +function canContainIriValue( + property: PropertySchema, + types: Record, +): boolean { + return property.range.some((typeUri) => + typeUri === XSD_ANY_URI || typeUri in types && types[typeUri].entity + ); +} + +function addPortableIriKeys( + keys: Set, + property: PropertySchema, + types: Record, +): void { + if (!canContainIriValue(property, types)) return; + keys.add(property.uri); + if (property.compactName != null) keys.add(property.compactName); + if (property.functional && property.redundantProperties != null) { + for (const redundantProperty of property.redundantProperties) { + keys.add(redundantProperty.uri); + if (redundantProperty.compactName != null) { + keys.add(redundantProperty.compactName); + } + } + } +} + /** * Generates the TypeScript classes from the given types. * @param types The types to generate classes from. @@ -210,7 +243,30 @@ export async function* generateClasses( isTemporalInstant, } from "@fedify/vocab-runtime/temporal";\n`; yield "\n\n"; - yield "const PORTABLE_IRI_PATTERN = /ap(?:\\+ef61)?:\\/\\//i;\n\n"; + const portableIriKeys = new Set(["@id", "id"]); + for (const type of Object.values(types)) { + for (const property of type.properties) { + addPortableIriKeys(portableIriKeys, property, types); + } + } + yield "const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i;\n"; + yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ + JSON.stringify([...portableIriKeys].sort()) + });\n\n`; + yield `function hasPortableIri(value: unknown, key?: string): boolean { + if (typeof value === "string") { + return key != null && PORTABLE_IRI_KEYS.has(key) && + PORTABLE_IRI_PATTERN.test(value); + } + if (Array.isArray(value)) { + return value.some((item) => hasPortableIri(item, key)); + } + if (value == null || typeof value !== "object") return false; + const object = value as Record; + return globalThis.Object.keys(object).some((entryKey) => + hasPortableIri(object[entryKey], entryKey) + ); +}\n\n`; const moduleVarNames = new Map(); const sorted = sortTopologically(types); for (const typeUri of sorted) { diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 1ab749ca0..fb98ac5c3 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -535,8 +535,7 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const jsonText = JSON.stringify(json); - if (jsonText == null || !PORTABLE_IRI_PATTERN.test(jsonText)) { + if (!hasPortableIri(json)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 82c9a6ad4..a15b7dfc7 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -599,6 +599,26 @@ test("fromJsonLd() handles portable ActivityPub IRIs", async () => { ); }); +test("fromJsonLd() caches text that mentions portable ActivityPub IRIs", async () => { + const noteJson = { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { extra: "https://example.com/ns#extra" }, + ], + type: "Note", + id: "https://example.com/notes/1", + content: "This is text about ap://did:key:z6Mkabc/actor.", + extra: "This extension property should stay cached.", + }; + + const note = await Note.fromJsonLd(noteJson, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await note.toJsonLd(), noteJson); +}); + test({ name: "Activity.getObject()", permissions: { env: true, read: true }, From b23d14d797066a41598a92eb8bc719875a802650 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 22:53:55 +0900 Subject: [PATCH 06/55] Harden portable IRI cache checks Portable IRI formatting now preserves pct-encoded DID authority boundaries, and generated cache detection now inspects expanded JSON-LD with bounded traversal. That keeps alias-expanded portable IRIs from being cached in their raw form while avoiding unnecessary context walks. https://github.com/fedify-dev/fedify/pull/850#discussion_r3492130053 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492147398 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492147407 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 20 +++ packages/vocab-runtime/src/url.ts | 15 +- .../src/__snapshots__/class.test.ts.deno.snap | 169 +++++++++--------- .../src/__snapshots__/class.test.ts.node.snap | 169 +++++++++--------- .../src/__snapshots__/class.test.ts.snap | 169 +++++++++--------- packages/vocab-tools/src/class.ts | 7 +- packages/vocab-tools/src/codec.ts | 2 +- packages/vocab/src/vocab.test.ts | 26 +++ 8 files changed, 317 insertions(+), 260 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 7c7fbe420..62b5e159c 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -54,6 +54,26 @@ test("formatIri() emits canonical portable ActivityPub URI syntax", () => { ); }); +test("formatIri() preserves DID authority pct-encoded delimiters", () => { + const parsed = parseIri("ap://did:example:abc%2Fdef/actor"); + deepStrictEqual( + parsed, + new URL("ap+ef61://did%3Aexample%3Aabc%252Fdef/actor"), + ); + deepStrictEqual( + formatIri(parsed), + "ap+ef61://did:example:abc%2Fdef/actor", + ); + deepStrictEqual( + parseIri(formatIri(parsed)), + parsed, + ); + deepStrictEqual( + formatIri(new URL("ap+ef61://did%3Aexample%3Aabc%2Fdef/actor")), + "ap+ef61://did:example:abc%2Fdef/actor", + ); +}); + test("validatePublicUrl()", async () => { await rejects(() => validatePublicUrl("ftp://localhost"), UrlError); await rejects( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 8c11754ac..16f2df9d3 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -11,6 +11,7 @@ export class UrlError extends Error { const PORTABLE_IRI_PATTERN = /^(ap|ap\+ef61):\/\/([^/?#]*)([^?#]*)(\?[^#]*)?(#.*)?$/i; +const INVALID_PERCENT_ENCODING_PATTERN = /%(?![0-9A-Fa-f]{2})/; /** * Checks whether the given string can be parsed as an IRI. @@ -29,7 +30,7 @@ export function canParseIri(iri: string, base?: string | URL): boolean { */ export function parseIri(iri: string | URL, base?: string | URL): URL { if (iri instanceof URL) { - return parsePortableIri(iri.href) ?? new URL(iri.href); + return normalizePortableUrl(iri) ?? new URL(iri.href); } const portable = parsePortableIri(iri); if (portable != null) return portable; @@ -63,12 +64,18 @@ function parsePortableIri(iri: string): URL | null { ); } +function normalizePortableUrl(iri: URL): URL | null { + if (iri.protocol !== "ap:" && iri.protocol !== "ap+ef61:") return null; + return new URL( + `ap+ef61://${iri.host}${iri.pathname}${iri.search}${iri.hash}`, + ); +} + function decodePortableAuthority(authority: string): string { - try { - return decodeURIComponent(authority); - } catch { + if (INVALID_PERCENT_ENCODING_PATTERN.test(authority)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } + return authority.replace(/%3A/gi, ":").replace(/%25/gi, "%"); } function parseAtUri(uri: string): URL { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index a14ff2177..b97b3f196 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -34,18 +34,19 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function hasPortableIri(value: unknown, key?: string): boolean { +function hasPortableIri(value: unknown, key?: string, depth = 0): boolean { + if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { return key != null && PORTABLE_IRI_KEYS.has(key) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key)); + return value.some((item) => hasPortableIri(item, key, depth + 1)); } if (value == null || typeof value !== \\"object\\") return false; const object = value as Record; return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey) + hasPortableIri(object[entryKey], entryKey, depth + 1) ); } @@ -12032,7 +12033,7 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13233,7 +13234,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14344,7 +14345,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17734,7 +17735,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18228,7 +18229,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18786,7 +18787,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19372,7 +19373,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20419,7 +20420,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20807,7 +20808,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21489,7 +21490,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22201,7 +22202,7 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23259,7 +23260,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23646,7 +23647,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24637,7 +24638,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25024,7 +25025,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26014,7 +26015,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26401,7 +26402,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26875,7 +26876,7 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27201,7 +27202,7 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28132,7 +28133,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29079,7 +29080,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29977,7 +29978,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30584,7 +30585,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31167,7 +31168,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32042,7 +32043,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32888,7 +32889,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33312,7 +33313,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33653,7 +33654,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33993,7 +33994,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40315,7 +40316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41139,7 +41140,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41479,7 +41480,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42585,7 +42586,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43191,7 +43192,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43573,7 +43574,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43916,7 +43917,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44257,7 +44258,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48593,7 +48594,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50164,7 +50165,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50561,7 +50562,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50900,7 +50901,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51237,7 +51238,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52146,7 +52147,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52623,7 +52624,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52963,7 +52964,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53304,7 +53305,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59626,7 +59627,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61597,7 +61598,7 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62092,7 +62093,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62434,7 +62435,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62778,7 +62779,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63117,7 +63118,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63456,7 +63457,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63795,7 +63796,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64134,7 +64135,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64471,7 +64472,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64774,7 +64775,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65114,7 +65115,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66222,7 +66223,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66982,7 +66983,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67799,7 +67800,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74163,7 +74164,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74977,7 +74978,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81299,7 +81300,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82683,7 +82684,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83471,7 +83472,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85337,7 +85338,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85819,7 +85820,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86162,7 +86163,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87804,7 +87805,7 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88215,7 +88216,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94537,7 +94538,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95604,7 +95605,7 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96004,7 +96005,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96343,7 +96344,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96951,7 +96952,7 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97338,7 +97339,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97682,7 +97683,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98024,7 +98025,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98366,7 +98367,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98704,7 +98705,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 3ba7d4af8..7381f6c4f 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -32,18 +32,19 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function hasPortableIri(value: unknown, key?: string): boolean { +function hasPortableIri(value: unknown, key?: string, depth = 0): boolean { + if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { return key != null && PORTABLE_IRI_KEYS.has(key) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key)); + return value.some((item) => hasPortableIri(item, key, depth + 1)); } if (value == null || typeof value !== \\"object\\") return false; const object = value as Record; return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey) + hasPortableIri(object[entryKey], entryKey, depth + 1) ); } @@ -12030,7 +12031,7 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13231,7 +13232,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14342,7 +14343,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17732,7 +17733,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18226,7 +18227,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18784,7 +18785,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19370,7 +19371,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20417,7 +20418,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20805,7 +20806,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21487,7 +21488,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22199,7 +22200,7 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23257,7 +23258,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23644,7 +23645,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24635,7 +24636,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25022,7 +25023,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26012,7 +26013,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26399,7 +26400,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26873,7 +26874,7 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27199,7 +27200,7 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28130,7 +28131,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29077,7 +29078,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29975,7 +29976,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30582,7 +30583,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31165,7 +31166,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32040,7 +32041,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32886,7 +32887,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33310,7 +33311,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33651,7 +33652,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33991,7 +33992,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40313,7 +40314,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41137,7 +41138,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41477,7 +41478,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42583,7 +42584,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43189,7 +43190,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43571,7 +43572,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43914,7 +43915,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44255,7 +44256,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48591,7 +48592,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50162,7 +50163,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50559,7 +50560,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50898,7 +50899,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51235,7 +51236,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52144,7 +52145,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52621,7 +52622,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52961,7 +52962,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53302,7 +53303,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59624,7 +59625,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61595,7 +61596,7 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62090,7 +62091,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62432,7 +62433,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62776,7 +62777,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63115,7 +63116,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63454,7 +63455,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63793,7 +63794,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64132,7 +64133,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64469,7 +64470,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64772,7 +64773,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65112,7 +65113,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66220,7 +66221,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66980,7 +66981,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67797,7 +67798,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74161,7 +74162,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74975,7 +74976,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81297,7 +81298,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82681,7 +82682,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83469,7 +83470,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85335,7 +85336,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85817,7 +85818,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86160,7 +86161,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87802,7 +87803,7 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88213,7 +88214,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94535,7 +94536,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95602,7 +95603,7 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96002,7 +96003,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96341,7 +96342,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96949,7 +96950,7 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97336,7 +97337,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97680,7 +97681,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98022,7 +98023,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98364,7 +98365,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98702,7 +98703,7 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 9c66f3bec..399160ad2 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -34,18 +34,19 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); -function hasPortableIri(value: unknown, key?: string): boolean { +function hasPortableIri(value: unknown, key?: string, depth = 0): boolean { + if (depth > 32 || key === "@context") return false; if (typeof value === "string") { return key != null && PORTABLE_IRI_KEYS.has(key) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key)); + return value.some((item) => hasPortableIri(item, key, depth + 1)); } if (value == null || typeof value !== "object") return false; const object = value as Record; return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey) + hasPortableIri(object[entryKey], entryKey, depth + 1) ); } @@ -12032,7 +12033,7 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -13233,7 +13234,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -14344,7 +14345,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -17734,7 +17735,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18228,7 +18229,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -18786,7 +18787,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -19372,7 +19373,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20419,7 +20420,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -20807,7 +20808,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -21489,7 +21490,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -22201,7 +22202,7 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23259,7 +23260,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -23646,7 +23647,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -24637,7 +24638,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -25024,7 +25025,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26014,7 +26015,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26401,7 +26402,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -26875,7 +26876,7 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -27201,7 +27202,7 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -28132,7 +28133,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29079,7 +29080,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -29977,7 +29978,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -30584,7 +30585,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -31167,7 +31168,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32042,7 +32043,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -32888,7 +32889,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33312,7 +33313,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33653,7 +33654,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -33993,7 +33994,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -40315,7 +40316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41139,7 +41140,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -41479,7 +41480,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -42585,7 +42586,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43191,7 +43192,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43573,7 +43574,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -43916,7 +43917,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -44257,7 +44258,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -48593,7 +48594,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50164,7 +50165,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50561,7 +50562,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -50900,7 +50901,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -51237,7 +51238,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52146,7 +52147,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52623,7 +52624,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -52963,7 +52964,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -53304,7 +53305,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -59626,7 +59627,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -61597,7 +61598,7 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62092,7 +62093,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62434,7 +62435,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -62778,7 +62779,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63117,7 +63118,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63456,7 +63457,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -63795,7 +63796,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64134,7 +64135,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64471,7 +64472,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -64774,7 +64775,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -65114,7 +65115,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66222,7 +66223,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -66982,7 +66983,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -67799,7 +67800,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74163,7 +74164,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -74977,7 +74978,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -81299,7 +81300,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -82683,7 +82684,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -83471,7 +83472,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85337,7 +85338,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -85819,7 +85820,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -86162,7 +86163,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -87804,7 +87805,7 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -88215,7 +88216,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -94537,7 +94538,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -95604,7 +95605,7 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96004,7 +96005,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96343,7 +96344,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -96951,7 +96952,7 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97338,7 +97339,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -97682,7 +97683,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98024,7 +98025,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98366,7 +98367,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { @@ -98704,7 +98705,7 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index dc53b3015..1d14e3333 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -253,18 +253,19 @@ export async function* generateClasses( yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ JSON.stringify([...portableIriKeys].sort()) });\n\n`; - yield `function hasPortableIri(value: unknown, key?: string): boolean { + yield `function hasPortableIri(value: unknown, key?: string, depth = 0): boolean { + if (depth > 32 || key === "@context") return false; if (typeof value === "string") { return key != null && PORTABLE_IRI_KEYS.has(key) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key)); + return value.some((item) => hasPortableIri(item, key, depth + 1)); } if (value == null || typeof value !== "object") return false; const object = value as Record; return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey) + hasPortableIri(object[entryKey], entryKey, depth + 1) ); }\n\n`; const moduleVarNames = new Map(); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index fb98ac5c3..78138c882 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -535,7 +535,7 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(json)) { + if (!hasPortableIri(values)) { instance._cachedJsonLd = structuredClone(json); } } catch { diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index a15b7dfc7..06ac8f592 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -619,6 +619,32 @@ test("fromJsonLd() caches text that mentions portable ActivityPub IRIs", async ( deepStrictEqual(await note.toJsonLd(), noteJson); }); +test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async () => { + const activity = await Activity.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + actorRef: { + "@id": "https://www.w3.org/ns/activitystreams#actor", + "@type": "@id", + }, + }, + ], + type: "Create", + actorRef: "ap://did:key:z6Mkabc/actor", + object: "https://example.com/objects/1", + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + + deepStrictEqual( + activity.actorId, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + ); + const jsonLd = await activity.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual(jsonLd.actor, "ap+ef61://did:key:z6Mkabc/actor"); +}); + test({ name: "Activity.getObject()", permissions: { env: true, read: true }, From e38aabb34a57faa06678d52461064c5fa5866060 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 23:10:45 +0900 Subject: [PATCH 07/55] Preserve portable IRI authority escapes Portable URL instances now use the same authority validation and encoding path as string inputs, so DID boundaries and DID-internal percent escapes round-trip consistently. Generated cache detection also treats fedify:url scalar values as IRI-bearing fields without disabling caching for plain text fields. https://github.com/fedify-dev/fedify/pull/850#discussion_r3492228076 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492228083 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492245022 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492260880 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492260886 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 20 +++++++++++++++++ packages/vocab-runtime/src/url.ts | 14 +++++------- .../src/__snapshots__/class.test.ts.deno.snap | 13 ++++++----- .../src/__snapshots__/class.test.ts.node.snap | 13 ++++++----- .../src/__snapshots__/class.test.ts.snap | 13 ++++++----- packages/vocab-tools/src/class.ts | 14 +++++++----- packages/vocab/src/vocab.test.ts | 22 +++++++++++++++++++ 7 files changed, 81 insertions(+), 28 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 62b5e159c..5b2bc04f2 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -40,6 +40,14 @@ test("parseIri() preserves existing URL parsing behavior", () => { ok(!canParseIri("ap://not-a-did/actor")); }); +test("parseIri() normalizes portable URL instances", () => { + deepStrictEqual( + parseIri(new URL("ap+ef61://did%3Aexample%3Aabc%2Fdef/actor")), + new URL("ap+ef61://did%3Aexample%3Aabc%252Fdef/actor"), + ); + ok(!canParseIri("ap+ef61://not-a-did/actor")); +}); + test("formatIri() emits canonical portable ActivityPub URI syntax", () => { const cases = [ new URL("ap://did%3Akey%3Az6Mkabc/actor"), @@ -74,6 +82,18 @@ test("formatIri() preserves DID authority pct-encoded delimiters", () => { ); }); +test("formatIri() preserves DID-internal pct-encoded authority characters", () => { + const parsed = parseIri("ap://did:web:example.com%3A3000/actor"); + deepStrictEqual( + parsed, + new URL("ap+ef61://did%3Aweb%3Aexample.com%253A3000/actor"), + ); + deepStrictEqual( + formatIri(parsed), + "ap+ef61://did:web:example.com%3A3000/actor", + ); +}); + test("validatePublicUrl()", async () => { await rejects(() => validatePublicUrl("ftp://localhost"), UrlError); await rejects( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 16f2df9d3..74eb3bed1 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -66,7 +66,7 @@ function parsePortableIri(iri: string): URL | null { function normalizePortableUrl(iri: URL): URL | null { if (iri.protocol !== "ap:" && iri.protocol !== "ap+ef61:") return null; - return new URL( + return parsePortableIri( `ap+ef61://${iri.host}${iri.pathname}${iri.search}${iri.hash}`, ); } @@ -75,17 +75,15 @@ function decodePortableAuthority(authority: string): string { if (INVALID_PERCENT_ENCODING_PATTERN.test(authority)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } + if (authority.startsWith("did:")) return authority; return authority.replace(/%3A/gi, ":").replace(/%25/gi, "%"); } function parseAtUri(uri: string): URL { - return new URL( - "at://" + - encodeURIComponent( - uri.includes("/", 5) ? uri.slice(5, uri.indexOf("/", 5)) : uri.slice(5), - ) + - (uri.includes("/", 5) ? uri.slice(uri.indexOf("/", 5)) : ""), - ); + const index = uri.indexOf("/", 5); + const authority = index >= 0 ? uri.slice(5, index) : uri.slice(5); + const path = index >= 0 ? uri.slice(index) : ""; + return new URL("at://" + encodeURIComponent(authority) + path); } /** diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index b97b3f196..d4dca0753 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -32,21 +32,24 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; -const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); +const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function hasPortableIri(value: unknown, key?: string, depth = 0): boolean { +function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { - return key != null && PORTABLE_IRI_KEYS.has(key) && + return key != null && + (PORTABLE_IRI_KEYS.has(key) || + key === \\"@value\\" && parentKey != null && + PORTABLE_IRI_KEYS.has(parentKey)) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key, depth + 1)); + return value.some((item) => hasPortableIri(item, key, depth + 1, parentKey)); } if (value == null || typeof value !== \\"object\\") return false; const object = value as Record; return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey, depth + 1) + hasPortableIri(object[entryKey], entryKey, depth + 1, key) ); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 7381f6c4f..2d4362472 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -30,21 +30,24 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; -const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); +const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function hasPortableIri(value: unknown, key?: string, depth = 0): boolean { +function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { - return key != null && PORTABLE_IRI_KEYS.has(key) && + return key != null && + (PORTABLE_IRI_KEYS.has(key) || + key === \\"@value\\" && parentKey != null && + PORTABLE_IRI_KEYS.has(parentKey)) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key, depth + 1)); + return value.some((item) => hasPortableIri(item, key, depth + 1, parentKey)); } if (value == null || typeof value !== \\"object\\") return false; const object = value as Record; return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey, depth + 1) + hasPortableIri(object[entryKey], entryKey, depth + 1, key) ); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 399160ad2..38a3d324e 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -32,21 +32,24 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; -const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); +const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","_misskey_quote","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","quoteUri","quoteUrl","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); -function hasPortableIri(value: unknown, key?: string, depth = 0): boolean { +function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { if (depth > 32 || key === "@context") return false; if (typeof value === "string") { - return key != null && PORTABLE_IRI_KEYS.has(key) && + return key != null && + (PORTABLE_IRI_KEYS.has(key) || + key === "@value" && parentKey != null && + PORTABLE_IRI_KEYS.has(parentKey)) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key, depth + 1)); + return value.some((item) => hasPortableIri(item, key, depth + 1, parentKey)); } if (value == null || typeof value !== "object") return false; const object = value as Record; return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey, depth + 1) + hasPortableIri(object[entryKey], entryKey, depth + 1, key) ); } diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 1d14e3333..aaece7ad3 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -11,6 +11,7 @@ import { import { emitOverride } from "./type.ts"; const XSD_ANY_URI = "http://www.w3.org/2001/XMLSchema#anyURI"; +const FEDIFY_URL = "fedify:url"; /** * Sorts the given types topologically so that the base types come before the @@ -180,7 +181,7 @@ function canContainIriValue( types: Record, ): boolean { return property.range.some((typeUri) => - typeUri === XSD_ANY_URI || typeUri in types && types[typeUri].entity + typeUri === XSD_ANY_URI || typeUri === FEDIFY_URL || types[typeUri]?.entity ); } @@ -253,19 +254,22 @@ export async function* generateClasses( yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ JSON.stringify([...portableIriKeys].sort()) });\n\n`; - yield `function hasPortableIri(value: unknown, key?: string, depth = 0): boolean { + yield `function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { if (depth > 32 || key === "@context") return false; if (typeof value === "string") { - return key != null && PORTABLE_IRI_KEYS.has(key) && + return key != null && + (PORTABLE_IRI_KEYS.has(key) || + key === "@value" && parentKey != null && + PORTABLE_IRI_KEYS.has(parentKey)) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key, depth + 1)); + return value.some((item) => hasPortableIri(item, key, depth + 1, parentKey)); } if (value == null || typeof value !== "object") return false; const object = value as Record; return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey, depth + 1) + hasPortableIri(object[entryKey], entryKey, depth + 1, key) ); }\n\n`; const moduleVarNames = new Map(); diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 06ac8f592..82e2c5526 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -645,6 +645,28 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( deepStrictEqual(jsonLd.actor, "ap+ef61://did:key:z6Mkabc/actor"); }); +test("fromJsonLd() formats portable IRIs in scalar URL values", async () => { + const note = await Note.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://gotosocial.org/ns", + { quoteUrl: "as:quoteUrl" }, + ], + type: "Note", + id: "https://example.com/notes/1", + quoteUrl: "ap://did:key:z6Mkabc/objects/1", + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + + deepStrictEqual( + note.quoteUrl, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/objects/1"), + ); + const jsonLd = await note.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual(jsonLd.quoteUrl, "ap+ef61://did:key:z6Mkabc/objects/1"); +}); + test({ name: "Activity.getObject()", permissions: { env: true, read: true }, From f8557a69eac5b411eb90d3590ec2ad4805100858 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 23:23:18 +0900 Subject: [PATCH 08/55] Tighten portable IRI edge handling Pathless portable ActivityPub IRIs are now rejected before URL normalization, matching FEP-ef61's required path component. Non-portable relative strings passed to formatIri now remain unchanged instead of raising from the fallback URL formatter. https://github.com/fedify-dev/fedify/pull/850#discussion_r3492350907 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492369902 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 9 +++++++++ packages/vocab-runtime/src/url.ts | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 5b2bc04f2..f1b65ff91 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -40,6 +40,14 @@ test("parseIri() preserves existing URL parsing behavior", () => { ok(!canParseIri("ap://not-a-did/actor")); }); +test("parseIri() rejects portable IRIs without paths", () => { + ok(!canParseIri("ap://did:key:z6Mkabc")); + ok( + !canParseIri("ap://did:key:z6Mkabc?gateways=https%3A%2F%2Fserver.example"), + ); + ok(!canParseIri("ap://did:key:z6Mkabc#actor")); +}); + test("parseIri() normalizes portable URL instances", () => { deepStrictEqual( parseIri(new URL("ap+ef61://did%3Aexample%3Aabc%2Fdef/actor")), @@ -60,6 +68,7 @@ test("formatIri() emits canonical portable ActivityPub URI syntax", () => { formatIri(new URL("https://example.com/actor")), "https://example.com/actor", ); + deepStrictEqual(formatIri("/actor"), "/actor"); }); test("formatIri() preserves DID authority pct-encoded delimiters", () => { diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 74eb3bed1..15066c6c7 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -45,7 +45,13 @@ export function parseIri(iri: string | URL, base?: string | URL): URL { */ export function formatIri(iri: string | URL): string { const parsed = parsePortableIri(iri instanceof URL ? iri.href : iri); - if (parsed == null) return iri instanceof URL ? iri.href : new URL(iri).href; + if (parsed == null) { + return iri instanceof URL + ? iri.href + : URL.canParse(iri) + ? new URL(iri).href + : iri; + } const authority = decodePortableAuthority(parsed.host); return `ap+ef61://${authority}${parsed.pathname}${parsed.search}${parsed.hash}`; } @@ -57,6 +63,9 @@ function parsePortableIri(iri: string): URL | null { if (!authority.startsWith("did:")) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } + if (match[3] === "") { + throw new TypeError("Invalid portable ActivityPub IRI path."); + } return new URL( `ap+ef61://${encodeURIComponent(authority)}${match[3]}${match[4] ?? ""}${ match[5] ?? "" From fad374c686302b3a15853621a1ee65a41a9b4ea9 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Mon, 29 Jun 2026 23:44:43 +0900 Subject: [PATCH 09/55] Accept DID scheme case variants Portable IRI authority validation now treats the DID scheme case-insensitively while preserving the authority spelling for round-tripping. This keeps raw and percent-encoded DID authorities on the same validation path. https://github.com/fedify-dev/fedify/pull/850#discussion_r3492431843 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492431865 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 14 ++++++++++++++ packages/vocab-runtime/src/url.ts | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index f1b65ff91..d7005358a 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -28,6 +28,20 @@ test("parseIri() accepts portable ActivityPub URI schemes", () => { } }); +test("parseIri() accepts DID schemes case-insensitively", () => { + const cases = [ + "ap://DID:key:z6Mkabc/actor", + "ap://DID%3Akey%3Az6Mkabc/actor", + ]; + for (const iri of cases) { + ok(canParseIri(iri)); + deepStrictEqual( + parseIri(iri), + new URL("ap+ef61://DID%3Akey%3Az6Mkabc/actor"), + ); + } +}); + test("parseIri() preserves existing URL parsing behavior", () => { deepStrictEqual( parseIri("/actor", new URL("https://example.com/users/alice")), diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 15066c6c7..f177eba58 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -12,6 +12,7 @@ export class UrlError extends Error { const PORTABLE_IRI_PATTERN = /^(ap|ap\+ef61):\/\/([^/?#]*)([^?#]*)(\?[^#]*)?(#.*)?$/i; const INVALID_PERCENT_ENCODING_PATTERN = /%(?![0-9A-Fa-f]{2})/; +const DID_SCHEME_PATTERN = /^did:/i; /** * Checks whether the given string can be parsed as an IRI. @@ -60,7 +61,7 @@ function parsePortableIri(iri: string): URL | null { const match = iri.match(PORTABLE_IRI_PATTERN); if (match == null) return null; const authority = decodePortableAuthority(match[2]); - if (!authority.startsWith("did:")) { + if (!DID_SCHEME_PATTERN.test(authority)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } if (match[3] === "") { @@ -84,7 +85,7 @@ function decodePortableAuthority(authority: string): string { if (INVALID_PERCENT_ENCODING_PATTERN.test(authority)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } - if (authority.startsWith("did:")) return authority; + if (DID_SCHEME_PATTERN.test(authority)) return authority; return authority.replace(/%3A/gi, ":").replace(/%25/gi, "%"); } From ac24a08fd7534305a7289deabe74ddbbd3b66a11 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 00:06:17 +0900 Subject: [PATCH 10/55] Preserve portable IRI cache data Portable IRI detection now treats JSON-LD value, list, and set containers as identifier positions when their parent property can hold IRIs. When a source document already uses those positions, the cached clone is normalized instead of being discarded, so extension data stays available without leaking raw portable IRI spelling. https://github.com/fedify-dev/fedify/pull/850#discussion_r3492573226 https://github.com/fedify-dev/fedify/pull/850#discussion_r3492600742 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 605 +++++++++++++----- .../src/__snapshots__/class.test.ts.node.snap | 605 +++++++++++++----- .../src/__snapshots__/class.test.ts.snap | 605 +++++++++++++----- packages/vocab-tools/src/class.ts | 36 +- packages/vocab-tools/src/codec.ts | 7 +- packages/vocab/src/vocab.test.ts | 38 ++ 6 files changed, 1392 insertions(+), 504 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index d4dca0753..94abbe8c1 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -34,13 +34,16 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); +function isPortableIriPosition(key: string, parentKey?: string): boolean { + return PORTABLE_IRI_KEYS.has(key) || + ((key === \\"@value\\" || key === \\"@list\\" || key === \\"@set\\") && + parentKey != null && PORTABLE_IRI_KEYS.has(parentKey)); +} + function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { - return key != null && - (PORTABLE_IRI_KEYS.has(key) || - key === \\"@value\\" && parentKey != null && - PORTABLE_IRI_KEYS.has(parentKey)) && + return key != null && isPortableIriPosition(key, parentKey) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { @@ -53,6 +56,33 @@ function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: str ); } +function normalizePortableIris(value: unknown, key?: string, depth = 0, parentKey?: string): unknown { + if (depth > 32 || key === \\"@context\\") return value; + if (typeof value === \\"string\\") { + return key != null && isPortableIriPosition(key, parentKey) && + PORTABLE_IRI_PATTERN.test(value) + ? formatIri(value) + : value; + } + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = normalizePortableIris(value[i], key, depth + 1, parentKey); + } + return value; + } + if (value == null || typeof value !== \\"object\\") return value; + const object = value as Record; + for (const entryKey of globalThis.Object.keys(object)) { + object[entryKey] = normalizePortableIris( + object[entryKey], + entryKey, + depth + 1, + key, + ); + } + return object; +} + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12036,8 +12066,11 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -13237,8 +13270,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -14348,8 +14384,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -17738,8 +17777,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -18232,8 +18274,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -18790,8 +18835,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -19376,8 +19424,11 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -20423,8 +20474,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -20811,8 +20865,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -21493,8 +21550,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -22205,8 +22265,11 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -23263,8 +23326,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -23650,8 +23716,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -24641,8 +24710,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -25028,8 +25100,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26018,8 +26093,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26405,8 +26483,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26879,8 +26960,11 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -27205,8 +27289,11 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -28136,8 +28223,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -29083,8 +29173,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -29981,8 +30074,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -30588,8 +30684,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -31171,8 +31270,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -32046,8 +32148,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -32892,8 +32997,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33316,8 +33424,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33657,8 +33768,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33997,8 +34111,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -40319,8 +40436,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -41143,8 +41263,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -41483,8 +41606,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -42589,8 +42715,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43195,8 +43324,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43577,8 +43709,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43920,8 +44055,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -44261,8 +44399,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -48597,8 +48738,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -50168,8 +50312,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -50565,8 +50712,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -50904,8 +51054,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -51241,8 +51394,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -52150,8 +52306,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -52627,8 +52786,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -52967,8 +53129,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -53308,8 +53473,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -59630,8 +59798,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -61601,8 +61772,11 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62096,8 +62270,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62438,8 +62615,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62782,8 +62962,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63121,8 +63304,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63460,8 +63646,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63799,8 +63988,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64138,8 +64330,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64475,8 +64670,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64778,8 +64976,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -65118,8 +65319,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -66226,8 +66430,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -66986,8 +67193,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -67803,8 +68013,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -74167,8 +74380,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -74981,8 +75197,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -81303,8 +81522,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -82687,8 +82909,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -83475,8 +83700,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -85341,8 +85569,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -85823,8 +86054,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -86166,8 +86400,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -87808,8 +88045,11 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -88219,8 +88459,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -94541,8 +94784,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -95608,8 +95854,11 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96008,8 +96257,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96347,8 +96599,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96955,8 +97210,11 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -97342,8 +97600,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -97686,8 +97947,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98028,8 +98292,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98370,8 +98637,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98708,8 +98978,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 2d4362472..7c3918afa 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -32,13 +32,16 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); +function isPortableIriPosition(key: string, parentKey?: string): boolean { + return PORTABLE_IRI_KEYS.has(key) || + ((key === \\"@value\\" || key === \\"@list\\" || key === \\"@set\\") && + parentKey != null && PORTABLE_IRI_KEYS.has(parentKey)); +} + function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { - return key != null && - (PORTABLE_IRI_KEYS.has(key) || - key === \\"@value\\" && parentKey != null && - PORTABLE_IRI_KEYS.has(parentKey)) && + return key != null && isPortableIriPosition(key, parentKey) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { @@ -51,6 +54,33 @@ function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: str ); } +function normalizePortableIris(value: unknown, key?: string, depth = 0, parentKey?: string): unknown { + if (depth > 32 || key === \\"@context\\") return value; + if (typeof value === \\"string\\") { + return key != null && isPortableIriPosition(key, parentKey) && + PORTABLE_IRI_PATTERN.test(value) + ? formatIri(value) + : value; + } + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = normalizePortableIris(value[i], key, depth + 1, parentKey); + } + return value; + } + if (value == null || typeof value !== \\"object\\") return value; + const object = value as Record; + for (const entryKey of globalThis.Object.keys(object)) { + object[entryKey] = normalizePortableIris( + object[entryKey], + entryKey, + depth + 1, + key, + ); + } + return object; +} + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12034,8 +12064,11 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -13235,8 +13268,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -14346,8 +14382,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -17736,8 +17775,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -18230,8 +18272,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -18788,8 +18833,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -19374,8 +19422,11 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -20421,8 +20472,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -20809,8 +20863,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -21491,8 +21548,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -22203,8 +22263,11 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -23261,8 +23324,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -23648,8 +23714,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -24639,8 +24708,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -25026,8 +25098,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26016,8 +26091,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26403,8 +26481,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26877,8 +26958,11 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -27203,8 +27287,11 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -28134,8 +28221,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -29081,8 +29171,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -29979,8 +30072,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -30586,8 +30682,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -31169,8 +31268,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -32044,8 +32146,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -32890,8 +32995,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33314,8 +33422,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33655,8 +33766,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33995,8 +34109,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -40317,8 +40434,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -41141,8 +41261,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -41481,8 +41604,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -42587,8 +42713,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43193,8 +43322,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43575,8 +43707,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43918,8 +44053,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -44259,8 +44397,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -48595,8 +48736,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -50166,8 +50310,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -50563,8 +50710,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -50902,8 +51052,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -51239,8 +51392,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -52148,8 +52304,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -52625,8 +52784,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -52965,8 +53127,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -53306,8 +53471,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -59628,8 +59796,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -61599,8 +61770,11 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62094,8 +62268,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62436,8 +62613,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62780,8 +62960,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63119,8 +63302,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63458,8 +63644,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63797,8 +63986,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64136,8 +64328,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64473,8 +64668,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64776,8 +64974,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -65116,8 +65317,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -66224,8 +66428,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -66984,8 +67191,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -67801,8 +68011,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -74165,8 +74378,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -74979,8 +75195,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -81301,8 +81520,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -82685,8 +82907,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -83473,8 +83698,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -85339,8 +85567,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -85821,8 +86052,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -86164,8 +86398,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -87806,8 +88043,11 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -88217,8 +88457,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -94539,8 +94782,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -95606,8 +95852,11 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96006,8 +96255,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96345,8 +96597,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96953,8 +97208,11 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -97340,8 +97598,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -97684,8 +97945,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98026,8 +98290,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98368,8 +98635,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98706,8 +98976,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 38a3d324e..a9f915b64 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -34,13 +34,16 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","_misskey_quote","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","quoteUri","quoteUrl","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); +function isPortableIriPosition(key: string, parentKey?: string): boolean { + return PORTABLE_IRI_KEYS.has(key) || + ((key === "@value" || key === "@list" || key === "@set") && + parentKey != null && PORTABLE_IRI_KEYS.has(parentKey)); +} + function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { if (depth > 32 || key === "@context") return false; if (typeof value === "string") { - return key != null && - (PORTABLE_IRI_KEYS.has(key) || - key === "@value" && parentKey != null && - PORTABLE_IRI_KEYS.has(parentKey)) && + return key != null && isPortableIriPosition(key, parentKey) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { @@ -53,6 +56,33 @@ function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: str ); } +function normalizePortableIris(value: unknown, key?: string, depth = 0, parentKey?: string): unknown { + if (depth > 32 || key === "@context") return value; + if (typeof value === "string") { + return key != null && isPortableIriPosition(key, parentKey) && + PORTABLE_IRI_PATTERN.test(value) + ? formatIri(value) + : value; + } + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = normalizePortableIris(value[i], key, depth + 1, parentKey); + } + return value; + } + if (value == null || typeof value !== "object") return value; + const object = value as Record; + for (const entryKey of globalThis.Object.keys(object)) { + object[entryKey] = normalizePortableIris( + object[entryKey], + entryKey, + depth + 1, + key, + ); + } + return object; +} + import * as _ppM0 from "./preprocessors.ts"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12036,8 +12066,11 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -13237,8 +13270,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -14348,8 +14384,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -17738,8 +17777,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -18232,8 +18274,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -18790,8 +18835,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -19376,8 +19424,11 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -20423,8 +20474,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -20811,8 +20865,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -21493,8 +21550,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -22205,8 +22265,11 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -23263,8 +23326,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -23650,8 +23716,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -24641,8 +24710,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -25028,8 +25100,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -26018,8 +26093,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -26405,8 +26483,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -26879,8 +26960,11 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -27205,8 +27289,11 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -28136,8 +28223,11 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -29083,8 +29173,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -29981,8 +30074,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -30588,8 +30684,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -31171,8 +31270,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -32046,8 +32148,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -32892,8 +32997,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -33316,8 +33424,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -33657,8 +33768,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -33997,8 +34111,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -40319,8 +40436,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -41143,8 +41263,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -41483,8 +41606,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -42589,8 +42715,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -43195,8 +43324,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -43577,8 +43709,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -43920,8 +44055,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -44261,8 +44399,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -48597,8 +48738,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -50168,8 +50312,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -50565,8 +50712,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -50904,8 +51054,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -51241,8 +51394,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -52150,8 +52306,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -52627,8 +52786,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -52967,8 +53129,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -53308,8 +53473,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -59630,8 +59798,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -61601,8 +61772,11 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -62096,8 +62270,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -62438,8 +62615,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -62782,8 +62962,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -63121,8 +63304,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -63460,8 +63646,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -63799,8 +63988,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -64138,8 +64330,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -64475,8 +64670,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -64778,8 +64976,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -65118,8 +65319,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -66226,8 +66430,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -66986,8 +67193,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -67803,8 +68013,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -74167,8 +74380,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -74981,8 +75197,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -81303,8 +81522,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -82687,8 +82909,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -83475,8 +83700,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -85341,8 +85569,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -85823,8 +86054,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -86166,8 +86400,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -87808,8 +88045,11 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -88219,8 +88459,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -94541,8 +94784,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -95608,8 +95854,11 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -96008,8 +96257,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -96347,8 +96599,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -96955,8 +97210,11 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -97342,8 +97600,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -97686,8 +97947,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -98028,8 +98292,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -98370,8 +98637,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( @@ -98708,8 +98978,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index aaece7ad3..8efa1d3f1 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -254,13 +254,15 @@ export async function* generateClasses( yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ JSON.stringify([...portableIriKeys].sort()) });\n\n`; + yield `function isPortableIriPosition(key: string, parentKey?: string): boolean { + return PORTABLE_IRI_KEYS.has(key) || + ((key === "@value" || key === "@list" || key === "@set") && + parentKey != null && PORTABLE_IRI_KEYS.has(parentKey)); +}\n\n`; yield `function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { if (depth > 32 || key === "@context") return false; if (typeof value === "string") { - return key != null && - (PORTABLE_IRI_KEYS.has(key) || - key === "@value" && parentKey != null && - PORTABLE_IRI_KEYS.has(parentKey)) && + return key != null && isPortableIriPosition(key, parentKey) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { @@ -271,6 +273,32 @@ export async function* generateClasses( return globalThis.Object.keys(object).some((entryKey) => hasPortableIri(object[entryKey], entryKey, depth + 1, key) ); +}\n\n`; + yield `function normalizePortableIris(value: unknown, key?: string, depth = 0, parentKey?: string): unknown { + if (depth > 32 || key === "@context") return value; + if (typeof value === "string") { + return key != null && isPortableIriPosition(key, parentKey) && + PORTABLE_IRI_PATTERN.test(value) + ? formatIri(value) + : value; + } + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = normalizePortableIris(value[i], key, depth + 1, parentKey); + } + return value; + } + if (value == null || typeof value !== "object") return value; + const object = value as Record; + for (const entryKey of globalThis.Object.keys(object)) { + object[entryKey] = normalizePortableIris( + object[entryKey], + entryKey, + depth + 1, + key, + ); + } + return object; }\n\n`; const moduleVarNames = new Map(); const sorted = sortTopologically(types); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 78138c882..3b99bd7a4 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -535,8 +535,11 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (!hasPortableIri(values)) { - instance._cachedJsonLd = structuredClone(json); + const cachedJsonLd = structuredClone(json); + if (hasPortableIri(cachedJsonLd)) { + instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + } else if (!hasPortableIri(values)) { + instance._cachedJsonLd = cachedJsonLd; } } catch { getLogger(["fedify", "vocab"]).warn( diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 82e2c5526..061e4cd2f 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -619,6 +619,44 @@ test("fromJsonLd() caches text that mentions portable ActivityPub IRIs", async ( deepStrictEqual(await note.toJsonLd(), noteJson); }); +test("fromJsonLd() preserves extensions with portable ActivityPub IRIs", async () => { + const note = await Note.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + { extra: "https://example.com/ns#extra" }, + ], + type: "Note", + id: "ap://did:key:z6Mkabc/objects/1", + extra: "This extension property should stay cached.", + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + + const jsonLd = await note.toJsonLd() as Record; + deepStrictEqual(jsonLd.extra, "This extension property should stay cached."); + deepStrictEqual(jsonLd.id, "ap+ef61://did:key:z6Mkabc/objects/1"); +}); + +test("fromJsonLd() formats portable IRIs in JSON-LD containers", async () => { + const note = await Note.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: "https://example.com/notes/1", + attributedTo: { + "@list": ["ap://did:key:z6Mkabc/actor"], + }, + to: { + "@set": ["ap://did:key:z6Mkabc/followers"], + }, + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + + const jsonLd = await note.toJsonLd() as Record; + deepStrictEqual(jsonLd.attributedTo, { + "@list": ["ap+ef61://did:key:z6Mkabc/actor"], + }); + deepStrictEqual(jsonLd.to, { + "@set": ["ap+ef61://did:key:z6Mkabc/followers"], + }); +}); + test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async () => { const activity = await Activity.fromJsonLd({ "@context": [ From 938145fa7e4bea2fc4a14330bfac1bd964f52a05 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 01:07:23 +0900 Subject: [PATCH 11/55] Preserve aliased portable IRI caches Inline JSON-LD contexts can alias a known IRI property, so raw cache checks need to treat those aliases as portable IRI positions. The cached clone can then keep extension fields while still formatting the portable IRI value before it is reused. https://github.com/fedify-dev/fedify/pull/850#discussion_r3492726090 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 92 +++++++++++++++++-- .../src/__snapshots__/class.test.ts.node.snap | 92 +++++++++++++++++-- .../src/__snapshots__/class.test.ts.snap | 92 +++++++++++++++++-- packages/vocab-tools/src/class.ts | 90 ++++++++++++++++-- packages/vocab/src/vocab.test.ts | 5 +- 5 files changed, 330 insertions(+), 41 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 94abbe8c1..5ee3a431a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -34,50 +34,122 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function isPortableIriPosition(key: string, parentKey?: string): boolean { - return PORTABLE_IRI_KEYS.has(key) || +function isPortableIriPosition( + key: string, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): boolean { + return portableIriKeys.has(key) || ((key === \\"@value\\" || key === \\"@list\\" || key === \\"@set\\") && - parentKey != null && PORTABLE_IRI_KEYS.has(parentKey)); + parentKey != null && portableIriKeys.has(parentKey)); } -function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { +function addPortableIriContextAliases( + aliases: Set, + context: unknown, + depth = 0, +): void { + if (depth > 32 || context == null) return; + if (Array.isArray(context)) { + for (const entry of context) { + addPortableIriContextAliases(aliases, entry, depth + 1); + } + return; + } + if (typeof context !== \\"object\\") return; + const object = context as Record; + for (const [term, definition] of globalThis.Object.entries(object)) { + if (typeof definition === \\"string\\") { + if (PORTABLE_IRI_KEYS.has(definition)) aliases.add(term); + continue; + } + if (definition == null || typeof definition !== \\"object\\") continue; + const id = (definition as Record)[\\"@id\\"]; + if (typeof id === \\"string\\" && PORTABLE_IRI_KEYS.has(id)) { + aliases.add(term); + } + } +} + +function getPortableIriKeys( + object: Record, + portableIriKeys: ReadonlySet, +): ReadonlySet { + if (!(\\"@context\\" in object)) return portableIriKeys; + const aliases = new Set(); + addPortableIriContextAliases(aliases, object[\\"@context\\"]); + if (aliases.size < 1) return portableIriKeys; + return new Set([...portableIriKeys, ...aliases]); +} + +function hasPortableIri( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): boolean { if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { - return key != null && isPortableIriPosition(key, parentKey) && + return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key, depth + 1, parentKey)); + return value.some((item) => + hasPortableIri(item, key, depth + 1, parentKey, portableIriKeys) + ); } if (value == null || typeof value !== \\"object\\") return false; const object = value as Record; + const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey, depth + 1, key) + hasPortableIri( + object[entryKey], + entryKey, + depth + 1, + key, + nextPortableIriKeys, + ) ); } -function normalizePortableIris(value: unknown, key?: string, depth = 0, parentKey?: string): unknown { +function normalizePortableIris( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): unknown { if (depth > 32 || key === \\"@context\\") return value; if (typeof value === \\"string\\") { - return key != null && isPortableIriPosition(key, parentKey) && + return key != null && + isPortableIriPosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ? formatIri(value) : value; } if (Array.isArray(value)) { for (let i = 0; i < value.length; i++) { - value[i] = normalizePortableIris(value[i], key, depth + 1, parentKey); + value[i] = normalizePortableIris( + value[i], + key, + depth + 1, + parentKey, + portableIriKeys, + ); } return value; } if (value == null || typeof value !== \\"object\\") return value; const object = value as Record; + const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); for (const entryKey of globalThis.Object.keys(object)) { object[entryKey] = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, + nextPortableIriKeys, ); } return object; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 7c3918afa..544d7c897 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -32,50 +32,122 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function isPortableIriPosition(key: string, parentKey?: string): boolean { - return PORTABLE_IRI_KEYS.has(key) || +function isPortableIriPosition( + key: string, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): boolean { + return portableIriKeys.has(key) || ((key === \\"@value\\" || key === \\"@list\\" || key === \\"@set\\") && - parentKey != null && PORTABLE_IRI_KEYS.has(parentKey)); + parentKey != null && portableIriKeys.has(parentKey)); } -function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { +function addPortableIriContextAliases( + aliases: Set, + context: unknown, + depth = 0, +): void { + if (depth > 32 || context == null) return; + if (Array.isArray(context)) { + for (const entry of context) { + addPortableIriContextAliases(aliases, entry, depth + 1); + } + return; + } + if (typeof context !== \\"object\\") return; + const object = context as Record; + for (const [term, definition] of globalThis.Object.entries(object)) { + if (typeof definition === \\"string\\") { + if (PORTABLE_IRI_KEYS.has(definition)) aliases.add(term); + continue; + } + if (definition == null || typeof definition !== \\"object\\") continue; + const id = (definition as Record)[\\"@id\\"]; + if (typeof id === \\"string\\" && PORTABLE_IRI_KEYS.has(id)) { + aliases.add(term); + } + } +} + +function getPortableIriKeys( + object: Record, + portableIriKeys: ReadonlySet, +): ReadonlySet { + if (!(\\"@context\\" in object)) return portableIriKeys; + const aliases = new Set(); + addPortableIriContextAliases(aliases, object[\\"@context\\"]); + if (aliases.size < 1) return portableIriKeys; + return new Set([...portableIriKeys, ...aliases]); +} + +function hasPortableIri( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): boolean { if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { - return key != null && isPortableIriPosition(key, parentKey) && + return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key, depth + 1, parentKey)); + return value.some((item) => + hasPortableIri(item, key, depth + 1, parentKey, portableIriKeys) + ); } if (value == null || typeof value !== \\"object\\") return false; const object = value as Record; + const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey, depth + 1, key) + hasPortableIri( + object[entryKey], + entryKey, + depth + 1, + key, + nextPortableIriKeys, + ) ); } -function normalizePortableIris(value: unknown, key?: string, depth = 0, parentKey?: string): unknown { +function normalizePortableIris( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): unknown { if (depth > 32 || key === \\"@context\\") return value; if (typeof value === \\"string\\") { - return key != null && isPortableIriPosition(key, parentKey) && + return key != null && + isPortableIriPosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ? formatIri(value) : value; } if (Array.isArray(value)) { for (let i = 0; i < value.length; i++) { - value[i] = normalizePortableIris(value[i], key, depth + 1, parentKey); + value[i] = normalizePortableIris( + value[i], + key, + depth + 1, + parentKey, + portableIriKeys, + ); } return value; } if (value == null || typeof value !== \\"object\\") return value; const object = value as Record; + const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); for (const entryKey of globalThis.Object.keys(object)) { object[entryKey] = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, + nextPortableIriKeys, ); } return object; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index a9f915b64..f0a9673fb 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -34,50 +34,122 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","_misskey_quote","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","quoteUri","quoteUrl","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); -function isPortableIriPosition(key: string, parentKey?: string): boolean { - return PORTABLE_IRI_KEYS.has(key) || +function isPortableIriPosition( + key: string, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): boolean { + return portableIriKeys.has(key) || ((key === "@value" || key === "@list" || key === "@set") && - parentKey != null && PORTABLE_IRI_KEYS.has(parentKey)); + parentKey != null && portableIriKeys.has(parentKey)); } -function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { +function addPortableIriContextAliases( + aliases: Set, + context: unknown, + depth = 0, +): void { + if (depth > 32 || context == null) return; + if (Array.isArray(context)) { + for (const entry of context) { + addPortableIriContextAliases(aliases, entry, depth + 1); + } + return; + } + if (typeof context !== "object") return; + const object = context as Record; + for (const [term, definition] of globalThis.Object.entries(object)) { + if (typeof definition === "string") { + if (PORTABLE_IRI_KEYS.has(definition)) aliases.add(term); + continue; + } + if (definition == null || typeof definition !== "object") continue; + const id = (definition as Record)["@id"]; + if (typeof id === "string" && PORTABLE_IRI_KEYS.has(id)) { + aliases.add(term); + } + } +} + +function getPortableIriKeys( + object: Record, + portableIriKeys: ReadonlySet, +): ReadonlySet { + if (!("@context" in object)) return portableIriKeys; + const aliases = new Set(); + addPortableIriContextAliases(aliases, object["@context"]); + if (aliases.size < 1) return portableIriKeys; + return new Set([...portableIriKeys, ...aliases]); +} + +function hasPortableIri( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): boolean { if (depth > 32 || key === "@context") return false; if (typeof value === "string") { - return key != null && isPortableIriPosition(key, parentKey) && + return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key, depth + 1, parentKey)); + return value.some((item) => + hasPortableIri(item, key, depth + 1, parentKey, portableIriKeys) + ); } if (value == null || typeof value !== "object") return false; const object = value as Record; + const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey, depth + 1, key) + hasPortableIri( + object[entryKey], + entryKey, + depth + 1, + key, + nextPortableIriKeys, + ) ); } -function normalizePortableIris(value: unknown, key?: string, depth = 0, parentKey?: string): unknown { +function normalizePortableIris( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): unknown { if (depth > 32 || key === "@context") return value; if (typeof value === "string") { - return key != null && isPortableIriPosition(key, parentKey) && + return key != null && + isPortableIriPosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ? formatIri(value) : value; } if (Array.isArray(value)) { for (let i = 0; i < value.length; i++) { - value[i] = normalizePortableIris(value[i], key, depth + 1, parentKey); + value[i] = normalizePortableIris( + value[i], + key, + depth + 1, + parentKey, + portableIriKeys, + ); } return value; } if (value == null || typeof value !== "object") return value; const object = value as Record; + const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); for (const entryKey of globalThis.Object.keys(object)) { object[entryKey] = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, + nextPortableIriKeys, ); } return object; diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 8efa1d3f1..c4d29d7b7 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -254,48 +254,118 @@ export async function* generateClasses( yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ JSON.stringify([...portableIriKeys].sort()) });\n\n`; - yield `function isPortableIriPosition(key: string, parentKey?: string): boolean { - return PORTABLE_IRI_KEYS.has(key) || + yield `function isPortableIriPosition( + key: string, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): boolean { + return portableIriKeys.has(key) || ((key === "@value" || key === "@list" || key === "@set") && - parentKey != null && PORTABLE_IRI_KEYS.has(parentKey)); + parentKey != null && portableIriKeys.has(parentKey)); +}\n\n`; + yield `function addPortableIriContextAliases( + aliases: Set, + context: unknown, + depth = 0, +): void { + if (depth > 32 || context == null) return; + if (Array.isArray(context)) { + for (const entry of context) { + addPortableIriContextAliases(aliases, entry, depth + 1); + } + return; + } + if (typeof context !== "object") return; + const object = context as Record; + for (const [term, definition] of globalThis.Object.entries(object)) { + if (typeof definition === "string") { + if (PORTABLE_IRI_KEYS.has(definition)) aliases.add(term); + continue; + } + if (definition == null || typeof definition !== "object") continue; + const id = (definition as Record)["@id"]; + if (typeof id === "string" && PORTABLE_IRI_KEYS.has(id)) { + aliases.add(term); + } + } }\n\n`; - yield `function hasPortableIri(value: unknown, key?: string, depth = 0, parentKey?: string): boolean { + yield `function getPortableIriKeys( + object: Record, + portableIriKeys: ReadonlySet, +): ReadonlySet { + if (!("@context" in object)) return portableIriKeys; + const aliases = new Set(); + addPortableIriContextAliases(aliases, object["@context"]); + if (aliases.size < 1) return portableIriKeys; + return new Set([...portableIriKeys, ...aliases]); +}\n\n`; + yield `function hasPortableIri( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): boolean { if (depth > 32 || key === "@context") return false; if (typeof value === "string") { - return key != null && isPortableIriPosition(key, parentKey) && + return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value); } if (Array.isArray(value)) { - return value.some((item) => hasPortableIri(item, key, depth + 1, parentKey)); + return value.some((item) => + hasPortableIri(item, key, depth + 1, parentKey, portableIriKeys) + ); } if (value == null || typeof value !== "object") return false; const object = value as Record; + const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri(object[entryKey], entryKey, depth + 1, key) + hasPortableIri( + object[entryKey], + entryKey, + depth + 1, + key, + nextPortableIriKeys, + ) ); }\n\n`; - yield `function normalizePortableIris(value: unknown, key?: string, depth = 0, parentKey?: string): unknown { + yield `function normalizePortableIris( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, +): unknown { if (depth > 32 || key === "@context") return value; if (typeof value === "string") { - return key != null && isPortableIriPosition(key, parentKey) && + return key != null && + isPortableIriPosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ? formatIri(value) : value; } if (Array.isArray(value)) { for (let i = 0; i < value.length; i++) { - value[i] = normalizePortableIris(value[i], key, depth + 1, parentKey); + value[i] = normalizePortableIris( + value[i], + key, + depth + 1, + parentKey, + portableIriKeys, + ); } return value; } if (value == null || typeof value !== "object") return value; const object = value as Record; + const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); for (const entryKey of globalThis.Object.keys(object)) { object[entryKey] = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, + nextPortableIriKeys, ); } return object; diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 061e4cd2f..74918a6f1 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -662,6 +662,7 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( "@context": [ "https://www.w3.org/ns/activitystreams", { + extra: "https://example.com/ns#extra", actorRef: { "@id": "https://www.w3.org/ns/activitystreams#actor", "@type": "@id", @@ -671,6 +672,7 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( type: "Create", actorRef: "ap://did:key:z6Mkabc/actor", object: "https://example.com/objects/1", + extra: "This extension property should stay cached.", }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); deepStrictEqual( @@ -680,7 +682,8 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( const jsonLd = await activity.toJsonLd({ contextLoader: mockDocumentLoader, }) as Record; - deepStrictEqual(jsonLd.actor, "ap+ef61://did:key:z6Mkabc/actor"); + deepStrictEqual(jsonLd.actorRef, "ap+ef61://did:key:z6Mkabc/actor"); + deepStrictEqual(jsonLd.extra, "This extension property should stay cached."); }); test("fromJsonLd() formats portable IRIs in scalar URL values", async () => { From 16da439ffd688dd8b54cffd3b8e76c013677969e Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 02:31:55 +0900 Subject: [PATCH 12/55] Expand portable IRI context aliases Compact IRI aliases in inline JSON-LD contexts need the same raw cache handling as full IRI aliases. Expanding local prefixes lets the cached clone preserve caller terms and extension fields while still formatting portable IRI values before reuse. https://github.com/fedify-dev/fedify/pull/850#discussion_r3493258274 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 45 ++++++++++++++++--- .../src/__snapshots__/class.test.ts.node.snap | 45 ++++++++++++++++--- .../src/__snapshots__/class.test.ts.snap | 45 ++++++++++++++++--- packages/vocab-tools/src/class.ts | 42 ++++++++++++++--- packages/vocab/src/vocab.test.ts | 16 ++++++- 5 files changed, 172 insertions(+), 21 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 5ee3a431a..6fad8bccd 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -34,6 +34,9 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); +const ACTIVITYSTREAMS_CONTEXT = \\"https://www.w3.org/ns/activitystreams\\"; +const ACTIVITYSTREAMS_IRI_PREFIX = \\"https://www.w3.org/ns/activitystreams#\\"; + function isPortableIriPosition( key: string, parentKey?: string, @@ -44,15 +47,40 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } +function addContextIriPrefix( + prefixes: Map, + term: string, + iri: string, +): void { + if (!iri.endsWith(\\"#\\") && !iri.endsWith(\\"/\\") && !iri.endsWith(\\":\\")) return; + prefixes.set(term, iri); +} + +function expandContextIri( + iri: string, + prefixes: ReadonlyMap, +): string { + const separatorIndex = iri.indexOf(\\":\\"); + if (separatorIndex < 1) return iri; + const prefix = prefixes.get(iri.slice(0, separatorIndex)); + if (prefix == null) return iri; + return prefix + iri.slice(separatorIndex + 1); +} + function addPortableIriContextAliases( aliases: Set, context: unknown, + prefixes: Map, depth = 0, ): void { if (depth > 32 || context == null) return; + if (context === ACTIVITYSTREAMS_CONTEXT) { + prefixes.set(\\"as\\", ACTIVITYSTREAMS_IRI_PREFIX); + return; + } if (Array.isArray(context)) { for (const entry of context) { - addPortableIriContextAliases(aliases, entry, depth + 1); + addPortableIriContextAliases(aliases, entry, prefixes, depth + 1); } return; } @@ -60,13 +88,19 @@ function addPortableIriContextAliases( const object = context as Record; for (const [term, definition] of globalThis.Object.entries(object)) { if (typeof definition === \\"string\\") { - if (PORTABLE_IRI_KEYS.has(definition)) aliases.add(term); + const expandedDefinition = expandContextIri(definition, prefixes); + if (PORTABLE_IRI_KEYS.has(expandedDefinition)) aliases.add(term); + addContextIriPrefix(prefixes, term, expandedDefinition); continue; } if (definition == null || typeof definition !== \\"object\\") continue; const id = (definition as Record)[\\"@id\\"]; - if (typeof id === \\"string\\" && PORTABLE_IRI_KEYS.has(id)) { - aliases.add(term); + if (typeof id === \\"string\\") { + const expandedId = expandContextIri(id, prefixes); + if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); + if ((definition as Record)[\\"@prefix\\"] === true) { + addContextIriPrefix(prefixes, term, expandedId); + } } } } @@ -77,7 +111,8 @@ function getPortableIriKeys( ): ReadonlySet { if (!(\\"@context\\" in object)) return portableIriKeys; const aliases = new Set(); - addPortableIriContextAliases(aliases, object[\\"@context\\"]); + const prefixes = new Map(); + addPortableIriContextAliases(aliases, object[\\"@context\\"], prefixes); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 544d7c897..68cee63c3 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -32,6 +32,9 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); +const ACTIVITYSTREAMS_CONTEXT = \\"https://www.w3.org/ns/activitystreams\\"; +const ACTIVITYSTREAMS_IRI_PREFIX = \\"https://www.w3.org/ns/activitystreams#\\"; + function isPortableIriPosition( key: string, parentKey?: string, @@ -42,15 +45,40 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } +function addContextIriPrefix( + prefixes: Map, + term: string, + iri: string, +): void { + if (!iri.endsWith(\\"#\\") && !iri.endsWith(\\"/\\") && !iri.endsWith(\\":\\")) return; + prefixes.set(term, iri); +} + +function expandContextIri( + iri: string, + prefixes: ReadonlyMap, +): string { + const separatorIndex = iri.indexOf(\\":\\"); + if (separatorIndex < 1) return iri; + const prefix = prefixes.get(iri.slice(0, separatorIndex)); + if (prefix == null) return iri; + return prefix + iri.slice(separatorIndex + 1); +} + function addPortableIriContextAliases( aliases: Set, context: unknown, + prefixes: Map, depth = 0, ): void { if (depth > 32 || context == null) return; + if (context === ACTIVITYSTREAMS_CONTEXT) { + prefixes.set(\\"as\\", ACTIVITYSTREAMS_IRI_PREFIX); + return; + } if (Array.isArray(context)) { for (const entry of context) { - addPortableIriContextAliases(aliases, entry, depth + 1); + addPortableIriContextAliases(aliases, entry, prefixes, depth + 1); } return; } @@ -58,13 +86,19 @@ function addPortableIriContextAliases( const object = context as Record; for (const [term, definition] of globalThis.Object.entries(object)) { if (typeof definition === \\"string\\") { - if (PORTABLE_IRI_KEYS.has(definition)) aliases.add(term); + const expandedDefinition = expandContextIri(definition, prefixes); + if (PORTABLE_IRI_KEYS.has(expandedDefinition)) aliases.add(term); + addContextIriPrefix(prefixes, term, expandedDefinition); continue; } if (definition == null || typeof definition !== \\"object\\") continue; const id = (definition as Record)[\\"@id\\"]; - if (typeof id === \\"string\\" && PORTABLE_IRI_KEYS.has(id)) { - aliases.add(term); + if (typeof id === \\"string\\") { + const expandedId = expandContextIri(id, prefixes); + if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); + if ((definition as Record)[\\"@prefix\\"] === true) { + addContextIriPrefix(prefixes, term, expandedId); + } } } } @@ -75,7 +109,8 @@ function getPortableIriKeys( ): ReadonlySet { if (!(\\"@context\\" in object)) return portableIriKeys; const aliases = new Set(); - addPortableIriContextAliases(aliases, object[\\"@context\\"]); + const prefixes = new Map(); + addPortableIriContextAliases(aliases, object[\\"@context\\"], prefixes); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index f0a9673fb..aa607087b 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -34,6 +34,9 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","_misskey_quote","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","quoteUri","quoteUrl","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); +const ACTIVITYSTREAMS_CONTEXT = "https://www.w3.org/ns/activitystreams"; +const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#"; + function isPortableIriPosition( key: string, parentKey?: string, @@ -44,15 +47,40 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } +function addContextIriPrefix( + prefixes: Map, + term: string, + iri: string, +): void { + if (!iri.endsWith("#") && !iri.endsWith("/") && !iri.endsWith(":")) return; + prefixes.set(term, iri); +} + +function expandContextIri( + iri: string, + prefixes: ReadonlyMap, +): string { + const separatorIndex = iri.indexOf(":"); + if (separatorIndex < 1) return iri; + const prefix = prefixes.get(iri.slice(0, separatorIndex)); + if (prefix == null) return iri; + return prefix + iri.slice(separatorIndex + 1); +} + function addPortableIriContextAliases( aliases: Set, context: unknown, + prefixes: Map, depth = 0, ): void { if (depth > 32 || context == null) return; + if (context === ACTIVITYSTREAMS_CONTEXT) { + prefixes.set("as", ACTIVITYSTREAMS_IRI_PREFIX); + return; + } if (Array.isArray(context)) { for (const entry of context) { - addPortableIriContextAliases(aliases, entry, depth + 1); + addPortableIriContextAliases(aliases, entry, prefixes, depth + 1); } return; } @@ -60,13 +88,19 @@ function addPortableIriContextAliases( const object = context as Record; for (const [term, definition] of globalThis.Object.entries(object)) { if (typeof definition === "string") { - if (PORTABLE_IRI_KEYS.has(definition)) aliases.add(term); + const expandedDefinition = expandContextIri(definition, prefixes); + if (PORTABLE_IRI_KEYS.has(expandedDefinition)) aliases.add(term); + addContextIriPrefix(prefixes, term, expandedDefinition); continue; } if (definition == null || typeof definition !== "object") continue; const id = (definition as Record)["@id"]; - if (typeof id === "string" && PORTABLE_IRI_KEYS.has(id)) { - aliases.add(term); + if (typeof id === "string") { + const expandedId = expandContextIri(id, prefixes); + if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); + if ((definition as Record)["@prefix"] === true) { + addContextIriPrefix(prefixes, term, expandedId); + } } } } @@ -77,7 +111,8 @@ function getPortableIriKeys( ): ReadonlySet { if (!("@context" in object)) return portableIriKeys; const aliases = new Set(); - addPortableIriContextAliases(aliases, object["@context"]); + const prefixes = new Map(); + addPortableIriContextAliases(aliases, object["@context"], prefixes); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); } diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index c4d29d7b7..ff50ff3cd 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -254,6 +254,8 @@ export async function* generateClasses( yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ JSON.stringify([...portableIriKeys].sort()) });\n\n`; + yield `const ACTIVITYSTREAMS_CONTEXT = "https://www.w3.org/ns/activitystreams"; +const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n`; yield `function isPortableIriPosition( key: string, parentKey?: string, @@ -262,16 +264,39 @@ export async function* generateClasses( return portableIriKeys.has(key) || ((key === "@value" || key === "@list" || key === "@set") && parentKey != null && portableIriKeys.has(parentKey)); +}\n\n`; + yield `function addContextIriPrefix( + prefixes: Map, + term: string, + iri: string, +): void { + if (!iri.endsWith("#") && !iri.endsWith("/") && !iri.endsWith(":")) return; + prefixes.set(term, iri); +}\n\n`; + yield `function expandContextIri( + iri: string, + prefixes: ReadonlyMap, +): string { + const separatorIndex = iri.indexOf(":"); + if (separatorIndex < 1) return iri; + const prefix = prefixes.get(iri.slice(0, separatorIndex)); + if (prefix == null) return iri; + return prefix + iri.slice(separatorIndex + 1); }\n\n`; yield `function addPortableIriContextAliases( aliases: Set, context: unknown, + prefixes: Map, depth = 0, ): void { if (depth > 32 || context == null) return; + if (context === ACTIVITYSTREAMS_CONTEXT) { + prefixes.set("as", ACTIVITYSTREAMS_IRI_PREFIX); + return; + } if (Array.isArray(context)) { for (const entry of context) { - addPortableIriContextAliases(aliases, entry, depth + 1); + addPortableIriContextAliases(aliases, entry, prefixes, depth + 1); } return; } @@ -279,13 +304,19 @@ export async function* generateClasses( const object = context as Record; for (const [term, definition] of globalThis.Object.entries(object)) { if (typeof definition === "string") { - if (PORTABLE_IRI_KEYS.has(definition)) aliases.add(term); + const expandedDefinition = expandContextIri(definition, prefixes); + if (PORTABLE_IRI_KEYS.has(expandedDefinition)) aliases.add(term); + addContextIriPrefix(prefixes, term, expandedDefinition); continue; } if (definition == null || typeof definition !== "object") continue; const id = (definition as Record)["@id"]; - if (typeof id === "string" && PORTABLE_IRI_KEYS.has(id)) { - aliases.add(term); + if (typeof id === "string") { + const expandedId = expandContextIri(id, prefixes); + if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); + if ((definition as Record)["@prefix"] === true) { + addContextIriPrefix(prefixes, term, expandedId); + } } } }\n\n`; @@ -295,7 +326,8 @@ export async function* generateClasses( ): ReadonlySet { if (!("@context" in object)) return portableIriKeys; const aliases = new Set(); - addPortableIriContextAliases(aliases, object["@context"]); + const prefixes = new Map(); + addPortableIriContextAliases(aliases, object["@context"], prefixes); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); }\n\n`; diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 74918a6f1..cce70a433 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -662,9 +662,17 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( "@context": [ "https://www.w3.org/ns/activitystreams", { + as: { + "@id": "https://www.w3.org/ns/activitystreams#", + "@prefix": true, + }, extra: "https://example.com/ns#extra", actorRef: { - "@id": "https://www.w3.org/ns/activitystreams#actor", + "@id": "as:actor", + "@type": "@id", + }, + targetRef: { + "@id": "as:target", "@type": "@id", }, }, @@ -672,6 +680,7 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( type: "Create", actorRef: "ap://did:key:z6Mkabc/actor", object: "https://example.com/objects/1", + targetRef: "ap://did:key:z6Mkabc/target", extra: "This extension property should stay cached.", }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); @@ -679,10 +688,15 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( activity.actorId, new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), ); + deepStrictEqual( + activity.targetId, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/target"), + ); const jsonLd = await activity.toJsonLd({ contextLoader: mockDocumentLoader, }) as Record; deepStrictEqual(jsonLd.actorRef, "ap+ef61://did:key:z6Mkabc/actor"); + deepStrictEqual(jsonLd.targetRef, "ap+ef61://did:key:z6Mkabc/target"); deepStrictEqual(jsonLd.extra, "This extension property should stay cached."); }); From 0a5db0a18e578651cfbd9520ca9bc710381d4839 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 05:36:21 +0900 Subject: [PATCH 13/55] Preserve @id extension portable IRIs JSON-LD extension terms typed as @id can carry portable IRI values even when the term is not generated as a Fedify vocabulary property. Treating those terms as portable IRI positions keeps the cached JSON-LD clone and normalizes the value before it is reused. https://github.com/fedify-dev/fedify/pull/850#discussion_r3493624875 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 7 ++++- .../src/__snapshots__/class.test.ts.node.snap | 7 ++++- .../src/__snapshots__/class.test.ts.snap | 7 ++++- packages/vocab-tools/src/class.ts | 7 ++++- packages/vocab/src/vocab.test.ts | 28 +++++++++++++++++++ 5 files changed, 52 insertions(+), 4 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 6fad8bccd..1f696121b 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -97,7 +97,12 @@ function addPortableIriContextAliases( const id = (definition as Record)[\\"@id\\"]; if (typeof id === \\"string\\") { const expandedId = expandContextIri(id, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); + if ( + PORTABLE_IRI_KEYS.has(expandedId) || + (definition as Record)[\\"@type\\"] === \\"@id\\" + ) { + aliases.add(term); + } if ((definition as Record)[\\"@prefix\\"] === true) { addContextIriPrefix(prefixes, term, expandedId); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 68cee63c3..dbfd2a445 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -95,7 +95,12 @@ function addPortableIriContextAliases( const id = (definition as Record)[\\"@id\\"]; if (typeof id === \\"string\\") { const expandedId = expandContextIri(id, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); + if ( + PORTABLE_IRI_KEYS.has(expandedId) || + (definition as Record)[\\"@type\\"] === \\"@id\\" + ) { + aliases.add(term); + } if ((definition as Record)[\\"@prefix\\"] === true) { addContextIriPrefix(prefixes, term, expandedId); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index aa607087b..2d37e56e5 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -97,7 +97,12 @@ function addPortableIriContextAliases( const id = (definition as Record)["@id"]; if (typeof id === "string") { const expandedId = expandContextIri(id, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); + if ( + PORTABLE_IRI_KEYS.has(expandedId) || + (definition as Record)["@type"] === "@id" + ) { + aliases.add(term); + } if ((definition as Record)["@prefix"] === true) { addContextIriPrefix(prefixes, term, expandedId); } diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index ff50ff3cd..b80f597a4 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -313,7 +313,12 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n const id = (definition as Record)["@id"]; if (typeof id === "string") { const expandedId = expandContextIri(id, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); + if ( + PORTABLE_IRI_KEYS.has(expandedId) || + (definition as Record)["@type"] === "@id" + ) { + aliases.add(term); + } if ((definition as Record)["@prefix"] === true) { addContextIriPrefix(prefixes, term, expandedId); } diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index cce70a433..7ecbdbd12 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -667,6 +667,10 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( "@prefix": true, }, extra: "https://example.com/ns#extra", + extraRef: { + "@id": "https://example.com/ns#extraRef", + "@type": "@id", + }, actorRef: { "@id": "as:actor", "@type": "@id", @@ -682,6 +686,7 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( object: "https://example.com/objects/1", targetRef: "ap://did:key:z6Mkabc/target", extra: "This extension property should stay cached.", + extraRef: "ap://did:key:z6Mkabc/extra", }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); deepStrictEqual( @@ -698,6 +703,29 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( deepStrictEqual(jsonLd.actorRef, "ap+ef61://did:key:z6Mkabc/actor"); deepStrictEqual(jsonLd.targetRef, "ap+ef61://did:key:z6Mkabc/target"); deepStrictEqual(jsonLd.extra, "This extension property should stay cached."); + deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); +}); + +test("fromJsonLd() preserves portable IRIs in @id extension terms", async () => { + const note = await Note.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + extraRef: { + "@id": "https://example.com/ns#extraRef", + "@type": "@id", + }, + }, + ], + type: "Note", + id: "https://example.com/notes/1", + extraRef: "ap://did:key:z6Mkabc/extra", + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + + const jsonLd = await note.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); }); test("fromJsonLd() formats portable IRIs in scalar URL values", async () => { From 06696b2f9fb59ca62b09fbc321e2d2645da58871 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 05:52:26 +0900 Subject: [PATCH 14/55] Respect remote portable IRI contexts Remote JSON-LD contexts can mark compacted extension terms as IRI values even when the cached JSON-LD only carries a context URL. Load those contexts while deciding which cached fields need portable IRI formatting, so unknown extension fields stay cached without rewriting plain text that merely mentions an ap:// string. Also treat @type: @id term definitions as IRI-valued even when the term has no explicit @id mapping, matching JSON-LD term definition semantics. https://github.com/fedify-dev/fedify/pull/850#discussion_r3494573994 https://github.com/fedify-dev/fedify/pull/850#discussion_r3494592350 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 2018 +++++++++++++++-- .../src/__snapshots__/class.test.ts.node.snap | 2018 +++++++++++++++-- .../src/__snapshots__/class.test.ts.snap | 2018 +++++++++++++++-- packages/vocab-tools/src/class.ts | 72 +- packages/vocab-tools/src/codec.ts | 24 +- packages/vocab/src/vocab.test.ts | 72 + 6 files changed, 5710 insertions(+), 512 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 1f696121b..e5fb781c4 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -94,15 +94,13 @@ function addPortableIriContextAliases( continue; } if (definition == null || typeof definition !== \\"object\\") continue; + if ((definition as Record)[\\"@type\\"] === \\"@id\\") { + aliases.add(term); + } const id = (definition as Record)[\\"@id\\"]; if (typeof id === \\"string\\") { const expandedId = expandContextIri(id, prefixes); - if ( - PORTABLE_IRI_KEYS.has(expandedId) || - (definition as Record)[\\"@type\\"] === \\"@id\\" - ) { - aliases.add(term); - } + if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); if ((definition as Record)[\\"@prefix\\"] === true) { addContextIriPrefix(prefixes, term, expandedId); } @@ -110,6 +108,50 @@ function addPortableIriContextAliases( } } +async function addRemotePortableIriContextAliases( + aliases: Set, + context: unknown, + prefixes: Map, + contextLoader: DocumentLoader, + loadedContexts: Set, + depth = 0, +): Promise { + if (depth > 32 || context == null) return; + if (typeof context === \\"string\\") { + if (context === ACTIVITYSTREAMS_CONTEXT) return; + if (loadedContexts.has(context)) return; + loadedContexts.add(context); + const remoteDocument = await contextLoader(context); + const document = remoteDocument.document; + const remoteContext = document != null && typeof document === \\"object\\" && + \\"@context\\" in document + ? (document as Record)[\\"@context\\"] + : document; + addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); + await addRemotePortableIriContextAliases( + aliases, + remoteContext, + prefixes, + contextLoader, + loadedContexts, + depth + 1, + ); + return; + } + if (Array.isArray(context)) { + for (const entry of context) { + await addRemotePortableIriContextAliases( + aliases, + entry, + prefixes, + contextLoader, + loadedContexts, + depth + 1, + ); + } + } +} + function getPortableIriKeys( object: Record, portableIriKeys: ReadonlySet, @@ -122,6 +164,26 @@ function getPortableIriKeys( return new Set([...portableIriKeys, ...aliases]); } +async function getPortableIriKeysWithLoader( + object: Record, + portableIriKeys: ReadonlySet, + contextLoader: DocumentLoader, +): Promise> { + if (!(\\"@context\\" in object)) return portableIriKeys; + const aliases = new Set(); + const prefixes = new Map(); + addPortableIriContextAliases(aliases, object[\\"@context\\"], prefixes); + await addRemotePortableIriContextAliases( + aliases, + object[\\"@context\\"], + prefixes, + contextLoader, + new Set(), + ); + if (aliases.size < 1) return portableIriKeys; + return new Set([...portableIriKeys, ...aliases]); +} + function hasPortableIri( value: unknown, key?: string, @@ -12179,8 +12241,28 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -13383,8 +13465,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -14497,8 +14599,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -17890,8 +18012,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -18387,8 +18529,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -18948,8 +19110,28 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -19537,8 +19719,28 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -20587,8 +20789,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -20978,8 +21200,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -21663,8 +21905,28 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -22378,8 +22640,28 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -23439,8 +23721,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -23829,8 +24131,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -24823,8 +25145,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -25213,8 +25555,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -26206,8 +26568,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -26596,8 +26978,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -27073,8 +27475,28 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -27402,8 +27824,28 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -28336,8 +28778,28 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -29286,8 +29748,28 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -30187,8 +30669,28 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -30797,8 +31299,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -31383,8 +31905,28 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -32261,8 +32803,28 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33110,8 +33672,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33537,8 +34119,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33881,8 +34483,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -34224,8 +34846,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -40549,8 +41191,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -41376,8 +42038,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -41719,8 +42401,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -42828,8 +43530,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -43437,8 +44159,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -43822,8 +44564,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -44168,8 +44930,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -44512,8 +45294,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -48851,8 +49653,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -50425,8 +51247,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -50825,8 +51667,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -51167,8 +52029,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -51507,8 +52389,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -52419,8 +53321,28 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -52899,8 +53821,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -53242,8 +54184,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -53586,8 +54548,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -59911,8 +60893,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -61885,8 +62887,28 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -62383,8 +63405,28 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -62728,8 +63770,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63075,8 +64137,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63417,8 +64499,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63759,8 +64861,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64101,8 +65223,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64443,8 +65585,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64783,8 +65945,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -65089,8 +66271,28 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -65432,8 +66634,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -66543,8 +67765,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -67306,8 +68548,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -68126,8 +69388,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -74493,8 +75775,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -75310,8 +76612,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -81635,8 +82957,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -83022,8 +84364,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -83813,8 +85175,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -85682,8 +87064,28 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -86167,8 +87569,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -86513,8 +87935,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -88158,8 +89600,28 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -88572,8 +90034,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -94897,8 +96379,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -95967,8 +97469,28 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -96370,8 +97892,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -96712,8 +98254,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -97323,8 +98885,28 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -97713,8 +99295,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98060,8 +99662,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98405,8 +100027,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98750,8 +100392,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -99091,8 +100753,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index dbfd2a445..9f93ce170 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -92,15 +92,13 @@ function addPortableIriContextAliases( continue; } if (definition == null || typeof definition !== \\"object\\") continue; + if ((definition as Record)[\\"@type\\"] === \\"@id\\") { + aliases.add(term); + } const id = (definition as Record)[\\"@id\\"]; if (typeof id === \\"string\\") { const expandedId = expandContextIri(id, prefixes); - if ( - PORTABLE_IRI_KEYS.has(expandedId) || - (definition as Record)[\\"@type\\"] === \\"@id\\" - ) { - aliases.add(term); - } + if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); if ((definition as Record)[\\"@prefix\\"] === true) { addContextIriPrefix(prefixes, term, expandedId); } @@ -108,6 +106,50 @@ function addPortableIriContextAliases( } } +async function addRemotePortableIriContextAliases( + aliases: Set, + context: unknown, + prefixes: Map, + contextLoader: DocumentLoader, + loadedContexts: Set, + depth = 0, +): Promise { + if (depth > 32 || context == null) return; + if (typeof context === \\"string\\") { + if (context === ACTIVITYSTREAMS_CONTEXT) return; + if (loadedContexts.has(context)) return; + loadedContexts.add(context); + const remoteDocument = await contextLoader(context); + const document = remoteDocument.document; + const remoteContext = document != null && typeof document === \\"object\\" && + \\"@context\\" in document + ? (document as Record)[\\"@context\\"] + : document; + addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); + await addRemotePortableIriContextAliases( + aliases, + remoteContext, + prefixes, + contextLoader, + loadedContexts, + depth + 1, + ); + return; + } + if (Array.isArray(context)) { + for (const entry of context) { + await addRemotePortableIriContextAliases( + aliases, + entry, + prefixes, + contextLoader, + loadedContexts, + depth + 1, + ); + } + } +} + function getPortableIriKeys( object: Record, portableIriKeys: ReadonlySet, @@ -120,6 +162,26 @@ function getPortableIriKeys( return new Set([...portableIriKeys, ...aliases]); } +async function getPortableIriKeysWithLoader( + object: Record, + portableIriKeys: ReadonlySet, + contextLoader: DocumentLoader, +): Promise> { + if (!(\\"@context\\" in object)) return portableIriKeys; + const aliases = new Set(); + const prefixes = new Map(); + addPortableIriContextAliases(aliases, object[\\"@context\\"], prefixes); + await addRemotePortableIriContextAliases( + aliases, + object[\\"@context\\"], + prefixes, + contextLoader, + new Set(), + ); + if (aliases.size < 1) return portableIriKeys; + return new Set([...portableIriKeys, ...aliases]); +} + function hasPortableIri( value: unknown, key?: string, @@ -12177,8 +12239,28 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -13381,8 +13463,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -14495,8 +14597,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -17888,8 +18010,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -18385,8 +18527,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -18946,8 +19108,28 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -19535,8 +19717,28 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -20585,8 +20787,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -20976,8 +21198,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -21661,8 +21903,28 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -22376,8 +22638,28 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -23437,8 +23719,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -23827,8 +24129,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -24821,8 +25143,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -25211,8 +25553,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -26204,8 +26566,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -26594,8 +26976,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -27071,8 +27473,28 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -27400,8 +27822,28 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -28334,8 +28776,28 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -29284,8 +29746,28 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -30185,8 +30667,28 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -30795,8 +31297,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -31381,8 +31903,28 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -32259,8 +32801,28 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33108,8 +33670,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33535,8 +34117,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33879,8 +34481,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -34222,8 +34844,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -40547,8 +41189,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -41374,8 +42036,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -41717,8 +42399,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -42826,8 +43528,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -43435,8 +44157,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -43820,8 +44562,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -44166,8 +44928,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -44510,8 +45292,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -48849,8 +49651,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -50423,8 +51245,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -50823,8 +51665,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -51165,8 +52027,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -51505,8 +52387,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -52417,8 +53319,28 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -52897,8 +53819,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -53240,8 +54182,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -53584,8 +54546,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -59909,8 +60891,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -61883,8 +62885,28 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -62381,8 +63403,28 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -62726,8 +63768,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63073,8 +64135,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63415,8 +64497,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63757,8 +64859,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64099,8 +65221,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64441,8 +65583,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64781,8 +65943,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -65087,8 +66269,28 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -65430,8 +66632,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -66541,8 +67763,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -67304,8 +68546,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -68124,8 +69386,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -74491,8 +75773,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -75308,8 +76610,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -81633,8 +82955,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -83020,8 +84362,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -83811,8 +85173,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -85680,8 +87062,28 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -86165,8 +87567,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -86511,8 +87933,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -88156,8 +89598,28 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -88570,8 +90032,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -94895,8 +96377,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -95965,8 +97467,28 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -96368,8 +97890,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -96710,8 +98252,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -97321,8 +98883,28 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -97711,8 +99293,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98058,8 +99660,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98403,8 +100025,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98748,8 +100390,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -99089,8 +100751,28 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 2d37e56e5..875b3a751 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -94,15 +94,13 @@ function addPortableIriContextAliases( continue; } if (definition == null || typeof definition !== "object") continue; + if ((definition as Record)["@type"] === "@id") { + aliases.add(term); + } const id = (definition as Record)["@id"]; if (typeof id === "string") { const expandedId = expandContextIri(id, prefixes); - if ( - PORTABLE_IRI_KEYS.has(expandedId) || - (definition as Record)["@type"] === "@id" - ) { - aliases.add(term); - } + if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); if ((definition as Record)["@prefix"] === true) { addContextIriPrefix(prefixes, term, expandedId); } @@ -110,6 +108,50 @@ function addPortableIriContextAliases( } } +async function addRemotePortableIriContextAliases( + aliases: Set, + context: unknown, + prefixes: Map, + contextLoader: DocumentLoader, + loadedContexts: Set, + depth = 0, +): Promise { + if (depth > 32 || context == null) return; + if (typeof context === "string") { + if (context === ACTIVITYSTREAMS_CONTEXT) return; + if (loadedContexts.has(context)) return; + loadedContexts.add(context); + const remoteDocument = await contextLoader(context); + const document = remoteDocument.document; + const remoteContext = document != null && typeof document === "object" && + "@context" in document + ? (document as Record)["@context"] + : document; + addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); + await addRemotePortableIriContextAliases( + aliases, + remoteContext, + prefixes, + contextLoader, + loadedContexts, + depth + 1, + ); + return; + } + if (Array.isArray(context)) { + for (const entry of context) { + await addRemotePortableIriContextAliases( + aliases, + entry, + prefixes, + contextLoader, + loadedContexts, + depth + 1, + ); + } + } +} + function getPortableIriKeys( object: Record, portableIriKeys: ReadonlySet, @@ -122,6 +164,26 @@ function getPortableIriKeys( return new Set([...portableIriKeys, ...aliases]); } +async function getPortableIriKeysWithLoader( + object: Record, + portableIriKeys: ReadonlySet, + contextLoader: DocumentLoader, +): Promise> { + if (!("@context" in object)) return portableIriKeys; + const aliases = new Set(); + const prefixes = new Map(); + addPortableIriContextAliases(aliases, object["@context"], prefixes); + await addRemotePortableIriContextAliases( + aliases, + object["@context"], + prefixes, + contextLoader, + new Set(), + ); + if (aliases.size < 1) return portableIriKeys; + return new Set([...portableIriKeys, ...aliases]); +} + function hasPortableIri( value: unknown, key?: string, @@ -12179,8 +12241,28 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -13383,8 +13465,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -14497,8 +14599,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -17890,8 +18012,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -18387,8 +18529,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -18948,8 +19110,28 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -19537,8 +19719,28 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -20587,8 +20789,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -20978,8 +21200,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -21663,8 +21905,28 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -22378,8 +22640,28 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -23439,8 +23721,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -23829,8 +24131,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -24823,8 +25145,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -25213,8 +25555,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -26206,8 +26568,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -26596,8 +26978,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -27073,8 +27475,28 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -27402,8 +27824,28 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -28336,8 +28778,28 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -29286,8 +29748,28 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -30187,8 +30669,28 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -30797,8 +31299,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -31383,8 +31905,28 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -32261,8 +32803,28 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33110,8 +33672,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33537,8 +34119,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -33881,8 +34483,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -34224,8 +34846,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -40549,8 +41191,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -41376,8 +42038,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -41719,8 +42401,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -42828,8 +43530,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -43437,8 +44159,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -43822,8 +44564,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -44168,8 +44930,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -44512,8 +45294,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -48851,8 +49653,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -50425,8 +51247,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -50825,8 +51667,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -51167,8 +52029,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -51507,8 +52389,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -52419,8 +53321,28 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -52899,8 +53821,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -53242,8 +54184,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -53586,8 +54548,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -59911,8 +60893,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -61885,8 +62887,28 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -62383,8 +63405,28 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -62728,8 +63770,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63075,8 +64137,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63417,8 +64499,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -63759,8 +64861,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64101,8 +65223,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64443,8 +65585,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -64783,8 +65945,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -65089,8 +66271,28 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -65432,8 +66634,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -66543,8 +67765,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -67306,8 +68548,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -68126,8 +69388,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -74493,8 +75775,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -75310,8 +76612,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -81635,8 +82957,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -83022,8 +84364,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -83813,8 +85175,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -85682,8 +87064,28 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -86167,8 +87569,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -86513,8 +87935,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -88158,8 +89600,28 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -88572,8 +90034,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -94897,8 +96379,28 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -95967,8 +97469,28 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -96370,8 +97892,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -96712,8 +98254,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -97323,8 +98885,28 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -97713,8 +99295,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98060,8 +99662,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98405,8 +100027,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -98750,8 +100392,28 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } @@ -99091,8 +100753,28 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index b80f597a4..a237320d2 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -310,20 +310,61 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n continue; } if (definition == null || typeof definition !== "object") continue; + if ((definition as Record)["@type"] === "@id") { + aliases.add(term); + } const id = (definition as Record)["@id"]; if (typeof id === "string") { const expandedId = expandContextIri(id, prefixes); - if ( - PORTABLE_IRI_KEYS.has(expandedId) || - (definition as Record)["@type"] === "@id" - ) { - aliases.add(term); - } + if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); if ((definition as Record)["@prefix"] === true) { addContextIriPrefix(prefixes, term, expandedId); } } } +}\n\n`; + yield `async function addRemotePortableIriContextAliases( + aliases: Set, + context: unknown, + prefixes: Map, + contextLoader: DocumentLoader, + loadedContexts: Set, + depth = 0, +): Promise { + if (depth > 32 || context == null) return; + if (typeof context === "string") { + if (context === ACTIVITYSTREAMS_CONTEXT) return; + if (loadedContexts.has(context)) return; + loadedContexts.add(context); + const remoteDocument = await contextLoader(context); + const document = remoteDocument.document; + const remoteContext = document != null && typeof document === "object" && + "@context" in document + ? (document as Record)["@context"] + : document; + addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); + await addRemotePortableIriContextAliases( + aliases, + remoteContext, + prefixes, + contextLoader, + loadedContexts, + depth + 1, + ); + return; + } + if (Array.isArray(context)) { + for (const entry of context) { + await addRemotePortableIriContextAliases( + aliases, + entry, + prefixes, + contextLoader, + loadedContexts, + depth + 1, + ); + } + } }\n\n`; yield `function getPortableIriKeys( object: Record, @@ -335,6 +376,25 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n addPortableIriContextAliases(aliases, object["@context"], prefixes); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); +}\n\n`; + yield `async function getPortableIriKeysWithLoader( + object: Record, + portableIriKeys: ReadonlySet, + contextLoader: DocumentLoader, +): Promise> { + if (!("@context" in object)) return portableIriKeys; + const aliases = new Set(); + const prefixes = new Map(); + addPortableIriContextAliases(aliases, object["@context"], prefixes); + await addRemotePortableIriContextAliases( + aliases, + object["@context"], + prefixes, + contextLoader, + new Set(), + ); + if (aliases.size < 1) return portableIriKeys; + return new Set([...portableIriKeys, ...aliases]); }\n\n`; yield `function hasPortableIri( value: unknown, diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 3b99bd7a4..bb496542a 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -536,8 +536,28 @@ export async function* generateDecoder( if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - if (hasPortableIri(cachedJsonLd)) { - instance._cachedJsonLd = normalizePortableIris(cachedJsonLd); + const cachedPortableIriKeys = + cachedJsonLd != null && typeof cachedJsonLd === "object" + ? await getPortableIriKeysWithLoader( + cachedJsonLd as Record, + PORTABLE_IRI_KEYS, + options.contextLoader ?? getDocumentLoader(), + ) + : PORTABLE_IRI_KEYS; + if (hasPortableIri( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + )) { + instance._cachedJsonLd = normalizePortableIris( + cachedJsonLd, + undefined, + 0, + undefined, + cachedPortableIriKeys, + ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; } diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 7ecbdbd12..b19932490 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -1,8 +1,10 @@ import { mockDocumentLoader, test } from "@fedify/fixture"; import { decodeMultibase, + type DocumentLoader, LanguageString, parseDecimal, + type RemoteDocument, } from "@fedify/vocab-runtime"; import { areAllScalarTypes, @@ -728,6 +730,76 @@ test("fromJsonLd() preserves portable IRIs in @id extension terms", async () => deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); }); +test("fromJsonLd() preserves portable IRIs in @id typed terms", async () => { + const note = await Note.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + "@vocab": "https://example.com/ns#", + extraRef: { "@type": "@id" }, + }, + ], + type: "Note", + id: "https://example.com/notes/1", + content: "This text mentions ap://did:key:z6Mkabc/text.", + extraRef: "ap://did:key:z6Mkabc/extra", + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + + const jsonLd = await note.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual( + jsonLd.content, + "This text mentions ap://did:key:z6Mkabc/text.", + ); + deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); +}); + +test("fromJsonLd() preserves portable IRIs hidden behind remote contexts", async () => { + const contextUrl = "https://example.com/contexts/portable-iris"; + const contextLoader: DocumentLoader = async ( + resource: string, + options, + ): Promise => { + if (resource === contextUrl) { + return { + contextUrl: null, + documentUrl: resource, + document: { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + "@vocab": "https://example.com/ns#", + extra: "https://example.com/ns#extra", + extraRef: { "@type": "@id" }, + }, + ], + }, + }; + } + return await mockDocumentLoader(resource, options); + }; + const note = await Note.fromJsonLd({ + "@context": contextUrl, + type: "Note", + id: "https://example.com/notes/1", + content: "This text mentions ap://did:key:z6Mkabc/text.", + extra: "This extension property should stay cached.", + extraRef: "ap://did:key:z6Mkabc/extra", + }, { documentLoader: mockDocumentLoader, contextLoader }); + + const jsonLd = await note.toJsonLd({ contextLoader }) as Record< + string, + unknown + >; + deepStrictEqual( + jsonLd.content, + "This text mentions ap://did:key:z6Mkabc/text.", + ); + deepStrictEqual(jsonLd.extra, "This extension property should stay cached."); + deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); +}); + test("fromJsonLd() formats portable IRIs in scalar URL values", async () => { const note = await Note.fromJsonLd({ "@context": [ From a47aad2b2ba93d7927143ad3a6b7d7d42378db15 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 06:10:21 +0900 Subject: [PATCH 15/55] Load nested portable IRI contexts Cached JSON-LD can hide portable IRIs behind a remote context on a nested extension object. Make the cache scan and normalization path loader-aware at every object boundary, so nested aliases are discovered without rewriting plain text fields. https://github.com/fedify-dev/fedify/pull/850#discussion_r3494673351 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 2054 ++++------------- .../src/__snapshots__/class.test.ts.node.snap | 2054 ++++------------- .../src/__snapshots__/class.test.ts.snap | 2054 ++++------------- packages/vocab-tools/src/class.ts | 108 +- packages/vocab-tools/src/codec.ts | 24 +- packages/vocab/src/vocab.test.ts | 61 + 6 files changed, 1471 insertions(+), 4884 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index e5fb781c4..759126e47 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -168,6 +168,7 @@ async function getPortableIriKeysWithLoader( object: Record, portableIriKeys: ReadonlySet, contextLoader: DocumentLoader, + loadedContexts = new Set(), ): Promise> { if (!(\\"@context\\" in object)) return portableIriKeys; const aliases = new Set(); @@ -178,7 +179,7 @@ async function getPortableIriKeysWithLoader( object[\\"@context\\"], prefixes, contextLoader, - new Set(), + loadedContexts, ); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); @@ -257,6 +258,113 @@ function normalizePortableIris( return object; } +async function hasPortableIriWithLoader( + value: unknown, + contextLoader: DocumentLoader, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, + loadedContexts = new Set(), +): Promise { + if (depth > 32 || key === \\"@context\\") return false; + if (typeof value === \\"string\\") { + return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value); + } + if (Array.isArray(value)) { + for (const item of value) { + if ( + await hasPortableIriWithLoader( + item, + contextLoader, + key, + depth + 1, + parentKey, + portableIriKeys, + loadedContexts, + ) + ) return true; + } + return false; + } + if (value == null || typeof value !== \\"object\\") return false; + const object = value as Record; + const nextPortableIriKeys = await getPortableIriKeysWithLoader( + object, + portableIriKeys, + contextLoader, + loadedContexts, + ); + for (const entryKey of globalThis.Object.keys(object)) { + if ( + await hasPortableIriWithLoader( + object[entryKey], + contextLoader, + entryKey, + depth + 1, + key, + nextPortableIriKeys, + loadedContexts, + ) + ) return true; + } + return false; +} + +async function normalizePortableIrisWithLoader( + value: unknown, + contextLoader: DocumentLoader, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, + loadedContexts = new Set(), +): Promise { + if (depth > 32 || key === \\"@context\\") return value; + if (typeof value === \\"string\\") { + return key != null && + isPortableIriPosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value) + ? formatIri(value) + : value; + } + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = await normalizePortableIrisWithLoader( + value[i], + contextLoader, + key, + depth + 1, + parentKey, + portableIriKeys, + loadedContexts, + ); + } + return value; + } + if (value == null || typeof value !== \\"object\\") return value; + const object = value as Record; + const nextPortableIriKeys = await getPortableIriKeysWithLoader( + object, + portableIriKeys, + contextLoader, + loadedContexts, + ); + for (const entryKey of globalThis.Object.keys(object)) { + object[entryKey] = await normalizePortableIrisWithLoader( + object[entryKey], + contextLoader, + entryKey, + depth + 1, + key, + nextPortableIriKeys, + loadedContexts, + ); + } + return object; +} + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12241,27 +12349,11 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -13465,27 +13557,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -14599,27 +14675,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -18012,27 +18072,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -18529,27 +18573,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -19110,27 +19138,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -19719,27 +19731,11 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -20789,27 +20785,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -21200,27 +21180,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -21905,27 +21869,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -22640,27 +22588,11 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -23721,27 +23653,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -24131,27 +24047,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -25145,27 +25045,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -25555,27 +25439,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -26568,27 +26436,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -26978,27 +26830,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -27475,27 +27311,11 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -27824,27 +27644,11 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -28778,27 +28582,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -29748,27 +29536,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -30669,27 +30441,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -31299,27 +31055,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -31905,27 +31645,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -32803,27 +32527,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -33672,27 +33380,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34119,27 +33811,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34483,27 +34159,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34846,27 +34506,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -41191,27 +40835,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -42038,27 +41666,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -42401,27 +42013,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -43530,27 +43126,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44159,27 +43739,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44564,27 +44128,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44930,27 +44478,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -45294,27 +44826,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -49653,27 +49169,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -51247,27 +50747,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -51667,27 +51151,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -52029,27 +51497,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -52389,27 +51841,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -53321,27 +52757,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -53821,27 +53241,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -54184,27 +53588,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -54548,27 +53936,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -60893,27 +60265,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -62887,27 +62243,11 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -63405,27 +62745,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -63770,27 +63094,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64137,27 +63445,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64499,27 +63791,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64861,27 +64137,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65223,27 +64483,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65585,27 +64829,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65945,27 +65173,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -66271,27 +65483,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -66634,27 +65830,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -67765,27 +66945,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -68548,27 +67712,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -69388,27 +68536,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -75775,27 +74907,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -76612,27 +75728,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -82957,27 +82057,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -84364,27 +83448,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -85175,27 +84243,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87064,27 +86116,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87569,27 +86605,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87935,27 +86955,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -89600,27 +88604,11 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -90034,27 +89022,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -96379,27 +95351,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -97469,27 +96425,11 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -97892,27 +96832,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -98254,27 +97178,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -98885,27 +97793,11 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -99295,27 +98187,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -99662,27 +98538,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100027,27 +98887,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100392,27 +99236,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100753,27 +99581,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 9f93ce170..738d329dc 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -166,6 +166,7 @@ async function getPortableIriKeysWithLoader( object: Record, portableIriKeys: ReadonlySet, contextLoader: DocumentLoader, + loadedContexts = new Set(), ): Promise> { if (!(\\"@context\\" in object)) return portableIriKeys; const aliases = new Set(); @@ -176,7 +177,7 @@ async function getPortableIriKeysWithLoader( object[\\"@context\\"], prefixes, contextLoader, - new Set(), + loadedContexts, ); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); @@ -255,6 +256,113 @@ function normalizePortableIris( return object; } +async function hasPortableIriWithLoader( + value: unknown, + contextLoader: DocumentLoader, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, + loadedContexts = new Set(), +): Promise { + if (depth > 32 || key === \\"@context\\") return false; + if (typeof value === \\"string\\") { + return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value); + } + if (Array.isArray(value)) { + for (const item of value) { + if ( + await hasPortableIriWithLoader( + item, + contextLoader, + key, + depth + 1, + parentKey, + portableIriKeys, + loadedContexts, + ) + ) return true; + } + return false; + } + if (value == null || typeof value !== \\"object\\") return false; + const object = value as Record; + const nextPortableIriKeys = await getPortableIriKeysWithLoader( + object, + portableIriKeys, + contextLoader, + loadedContexts, + ); + for (const entryKey of globalThis.Object.keys(object)) { + if ( + await hasPortableIriWithLoader( + object[entryKey], + contextLoader, + entryKey, + depth + 1, + key, + nextPortableIriKeys, + loadedContexts, + ) + ) return true; + } + return false; +} + +async function normalizePortableIrisWithLoader( + value: unknown, + contextLoader: DocumentLoader, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, + loadedContexts = new Set(), +): Promise { + if (depth > 32 || key === \\"@context\\") return value; + if (typeof value === \\"string\\") { + return key != null && + isPortableIriPosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value) + ? formatIri(value) + : value; + } + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = await normalizePortableIrisWithLoader( + value[i], + contextLoader, + key, + depth + 1, + parentKey, + portableIriKeys, + loadedContexts, + ); + } + return value; + } + if (value == null || typeof value !== \\"object\\") return value; + const object = value as Record; + const nextPortableIriKeys = await getPortableIriKeysWithLoader( + object, + portableIriKeys, + contextLoader, + loadedContexts, + ); + for (const entryKey of globalThis.Object.keys(object)) { + object[entryKey] = await normalizePortableIrisWithLoader( + object[entryKey], + contextLoader, + entryKey, + depth + 1, + key, + nextPortableIriKeys, + loadedContexts, + ); + } + return object; +} + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12239,27 +12347,11 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -13463,27 +13555,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -14597,27 +14673,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -18010,27 +18070,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -18527,27 +18571,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -19108,27 +19136,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -19717,27 +19729,11 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -20787,27 +20783,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -21198,27 +21178,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -21903,27 +21867,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -22638,27 +22586,11 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -23719,27 +23651,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -24129,27 +24045,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -25143,27 +25043,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -25553,27 +25437,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -26566,27 +26434,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -26976,27 +26828,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -27473,27 +27309,11 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -27822,27 +27642,11 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -28776,27 +28580,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -29746,27 +29534,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -30667,27 +30439,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -31297,27 +31053,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -31903,27 +31643,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -32801,27 +32525,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -33670,27 +33378,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34117,27 +33809,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34481,27 +34157,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34844,27 +34504,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -41189,27 +40833,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -42036,27 +41664,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -42399,27 +42011,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -43528,27 +43124,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44157,27 +43737,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44562,27 +44126,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44928,27 +44476,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -45292,27 +44824,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -49651,27 +49167,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -51245,27 +50745,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -51665,27 +51149,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -52027,27 +51495,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -52387,27 +51839,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -53319,27 +52755,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -53819,27 +53239,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -54182,27 +53586,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -54546,27 +53934,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -60891,27 +60263,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -62885,27 +62241,11 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -63403,27 +62743,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -63768,27 +63092,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64135,27 +63443,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64497,27 +63789,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64859,27 +64135,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65221,27 +64481,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65583,27 +64827,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65943,27 +65171,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -66269,27 +65481,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -66632,27 +65828,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -67763,27 +66943,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -68546,27 +67710,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -69386,27 +68534,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -75773,27 +74905,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -76610,27 +75726,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -82955,27 +82055,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -84362,27 +83446,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -85173,27 +84241,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87062,27 +86114,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87567,27 +86603,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87933,27 +86953,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -89598,27 +88602,11 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -90032,27 +89020,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -96377,27 +95349,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -97467,27 +96423,11 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -97890,27 +96830,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -98252,27 +97176,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -98883,27 +97791,11 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -99293,27 +98185,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -99660,27 +98536,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100025,27 +98885,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100390,27 +99234,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100751,27 +99579,11 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === \\"object\\" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 875b3a751..aa91ec6e1 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -168,6 +168,7 @@ async function getPortableIriKeysWithLoader( object: Record, portableIriKeys: ReadonlySet, contextLoader: DocumentLoader, + loadedContexts = new Set(), ): Promise> { if (!("@context" in object)) return portableIriKeys; const aliases = new Set(); @@ -178,7 +179,7 @@ async function getPortableIriKeysWithLoader( object["@context"], prefixes, contextLoader, - new Set(), + loadedContexts, ); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); @@ -257,6 +258,113 @@ function normalizePortableIris( return object; } +async function hasPortableIriWithLoader( + value: unknown, + contextLoader: DocumentLoader, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, + loadedContexts = new Set(), +): Promise { + if (depth > 32 || key === "@context") return false; + if (typeof value === "string") { + return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value); + } + if (Array.isArray(value)) { + for (const item of value) { + if ( + await hasPortableIriWithLoader( + item, + contextLoader, + key, + depth + 1, + parentKey, + portableIriKeys, + loadedContexts, + ) + ) return true; + } + return false; + } + if (value == null || typeof value !== "object") return false; + const object = value as Record; + const nextPortableIriKeys = await getPortableIriKeysWithLoader( + object, + portableIriKeys, + contextLoader, + loadedContexts, + ); + for (const entryKey of globalThis.Object.keys(object)) { + if ( + await hasPortableIriWithLoader( + object[entryKey], + contextLoader, + entryKey, + depth + 1, + key, + nextPortableIriKeys, + loadedContexts, + ) + ) return true; + } + return false; +} + +async function normalizePortableIrisWithLoader( + value: unknown, + contextLoader: DocumentLoader, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, + loadedContexts = new Set(), +): Promise { + if (depth > 32 || key === "@context") return value; + if (typeof value === "string") { + return key != null && + isPortableIriPosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value) + ? formatIri(value) + : value; + } + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = await normalizePortableIrisWithLoader( + value[i], + contextLoader, + key, + depth + 1, + parentKey, + portableIriKeys, + loadedContexts, + ); + } + return value; + } + if (value == null || typeof value !== "object") return value; + const object = value as Record; + const nextPortableIriKeys = await getPortableIriKeysWithLoader( + object, + portableIriKeys, + contextLoader, + loadedContexts, + ); + for (const entryKey of globalThis.Object.keys(object)) { + object[entryKey] = await normalizePortableIrisWithLoader( + object[entryKey], + contextLoader, + entryKey, + depth + 1, + key, + nextPortableIriKeys, + loadedContexts, + ); + } + return object; +} + import * as _ppM0 from "./preprocessors.ts"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12241,27 +12349,11 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -13465,27 +13557,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -14599,27 +14675,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -18012,27 +18072,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -18529,27 +18573,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -19110,27 +19138,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -19719,27 +19731,11 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -20789,27 +20785,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -21200,27 +21180,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -21905,27 +21869,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -22640,27 +22588,11 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -23721,27 +23653,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -24131,27 +24047,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -25145,27 +25045,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -25555,27 +25439,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -26568,27 +26436,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -26978,27 +26830,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -27475,27 +27311,11 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -27824,27 +27644,11 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -28778,27 +28582,11 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -29748,27 +29536,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -30669,27 +30441,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -31299,27 +31055,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -31905,27 +31645,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -32803,27 +32527,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -33672,27 +33380,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34119,27 +33811,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34483,27 +34159,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -34846,27 +34506,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -41191,27 +40835,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -42038,27 +41666,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -42401,27 +42013,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -43530,27 +43126,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44159,27 +43739,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44564,27 +44128,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -44930,27 +44478,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -45294,27 +44826,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -49653,27 +49169,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -51247,27 +50747,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -51667,27 +51151,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -52029,27 +51497,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -52389,27 +51841,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -53321,27 +52757,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -53821,27 +53241,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -54184,27 +53588,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -54548,27 +53936,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -60893,27 +60265,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -62887,27 +62243,11 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -63405,27 +62745,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -63770,27 +63094,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64137,27 +63445,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64499,27 +63791,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -64861,27 +64137,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65223,27 +64483,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65585,27 +64829,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -65945,27 +65173,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -66271,27 +65483,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -66634,27 +65830,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -67765,27 +66945,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -68548,27 +67712,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -69388,27 +68536,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -75775,27 +74907,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -76612,27 +75728,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -82957,27 +82057,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -84364,27 +83448,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -85175,27 +84243,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87064,27 +86116,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87569,27 +86605,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -87935,27 +86955,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -89600,27 +88604,11 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -90034,27 +89022,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -96379,27 +95351,11 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -97469,27 +96425,11 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -97892,27 +96832,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -98254,27 +97178,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -98885,27 +97793,11 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -99295,27 +98187,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -99662,27 +98538,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100027,27 +98887,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100392,27 +99236,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; @@ -100753,27 +99581,11 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index a237320d2..6e2ebf572 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -381,6 +381,7 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n object: Record, portableIriKeys: ReadonlySet, contextLoader: DocumentLoader, + loadedContexts = new Set(), ): Promise> { if (!("@context" in object)) return portableIriKeys; const aliases = new Set(); @@ -391,7 +392,7 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n object["@context"], prefixes, contextLoader, - new Set(), + loadedContexts, ); if (aliases.size < 1) return portableIriKeys; return new Set([...portableIriKeys, ...aliases]); @@ -466,6 +467,111 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n ); } return object; +}\n\n`; + yield `async function hasPortableIriWithLoader( + value: unknown, + contextLoader: DocumentLoader, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, + loadedContexts = new Set(), +): Promise { + if (depth > 32 || key === "@context") return false; + if (typeof value === "string") { + return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value); + } + if (Array.isArray(value)) { + for (const item of value) { + if ( + await hasPortableIriWithLoader( + item, + contextLoader, + key, + depth + 1, + parentKey, + portableIriKeys, + loadedContexts, + ) + ) return true; + } + return false; + } + if (value == null || typeof value !== "object") return false; + const object = value as Record; + const nextPortableIriKeys = await getPortableIriKeysWithLoader( + object, + portableIriKeys, + contextLoader, + loadedContexts, + ); + for (const entryKey of globalThis.Object.keys(object)) { + if ( + await hasPortableIriWithLoader( + object[entryKey], + contextLoader, + entryKey, + depth + 1, + key, + nextPortableIriKeys, + loadedContexts, + ) + ) return true; + } + return false; +}\n\n`; + yield `async function normalizePortableIrisWithLoader( + value: unknown, + contextLoader: DocumentLoader, + key?: string, + depth = 0, + parentKey?: string, + portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, + loadedContexts = new Set(), +): Promise { + if (depth > 32 || key === "@context") return value; + if (typeof value === "string") { + return key != null && + isPortableIriPosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value) + ? formatIri(value) + : value; + } + if (Array.isArray(value)) { + for (let i = 0; i < value.length; i++) { + value[i] = await normalizePortableIrisWithLoader( + value[i], + contextLoader, + key, + depth + 1, + parentKey, + portableIriKeys, + loadedContexts, + ); + } + return value; + } + if (value == null || typeof value !== "object") return value; + const object = value as Record; + const nextPortableIriKeys = await getPortableIriKeysWithLoader( + object, + portableIriKeys, + contextLoader, + loadedContexts, + ); + for (const entryKey of globalThis.Object.keys(object)) { + object[entryKey] = await normalizePortableIrisWithLoader( + object[entryKey], + contextLoader, + entryKey, + depth + 1, + key, + nextPortableIriKeys, + loadedContexts, + ); + } + return object; }\n\n`; const moduleVarNames = new Map(); const sorted = sortTopologically(types); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index bb496542a..860254b1d 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -536,27 +536,11 @@ export async function* generateDecoder( if (!("_fromSubclass" in options) || !options._fromSubclass) { try { const cachedJsonLd = structuredClone(json); - const cachedPortableIriKeys = - cachedJsonLd != null && typeof cachedJsonLd === "object" - ? await getPortableIriKeysWithLoader( - cachedJsonLd as Record, - PORTABLE_IRI_KEYS, - options.contextLoader ?? getDocumentLoader(), - ) - : PORTABLE_IRI_KEYS; - if (hasPortableIri( - cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, - )) { - instance._cachedJsonLd = normalizePortableIris( + const contextLoader = options.contextLoader ?? getDocumentLoader(); + if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { + instance._cachedJsonLd = await normalizePortableIrisWithLoader( cachedJsonLd, - undefined, - 0, - undefined, - cachedPortableIriKeys, + contextLoader, ); } else if (!hasPortableIri(values)) { instance._cachedJsonLd = cachedJsonLd; diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index b19932490..f5a3bd89c 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -800,6 +800,67 @@ test("fromJsonLd() preserves portable IRIs hidden behind remote contexts", async deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); }); +test("fromJsonLd() preserves portable IRIs hidden behind nested remote contexts", async () => { + const rootContextUrl = "https://example.com/contexts/nested-portable-iris"; + const nestedContextUrl = "https://example.com/contexts/nested-portable-ref"; + const contextLoader: DocumentLoader = async ( + resource: string, + options, + ): Promise => { + if (resource === rootContextUrl) { + return { + contextUrl: null, + documentUrl: resource, + document: { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + "@vocab": "https://example.com/ns#", + extraContainer: "https://example.com/ns#extraContainer", + }, + ], + }, + }; + } + if (resource === nestedContextUrl) { + return { + contextUrl: null, + documentUrl: resource, + document: { + "@context": { + "@vocab": "https://example.com/ns#", + extra: "https://example.com/ns#extra", + extraRef: { "@type": "@id" }, + }, + }, + }; + } + return await mockDocumentLoader(resource, options); + }; + const note = await Note.fromJsonLd({ + "@context": rootContextUrl, + type: "Note", + id: "https://example.com/notes/1", + extraContainer: { + "@context": nestedContextUrl, + content: "This text mentions ap://did:key:z6Mkabc/text.", + extra: "This nested extension object should stay cached.", + extraRef: "ap://did:key:z6Mkabc/extra", + }, + }, { documentLoader: mockDocumentLoader, contextLoader }); + + const jsonLd = await note.toJsonLd({ contextLoader }) as Record< + string, + unknown + >; + deepStrictEqual(jsonLd.extraContainer, { + "@context": nestedContextUrl, + content: "This text mentions ap://did:key:z6Mkabc/text.", + extra: "This nested extension object should stay cached.", + extraRef: "ap+ef61://did:key:z6Mkabc/extra", + }); +}); + test("fromJsonLd() formats portable IRIs in scalar URL values", async () => { const note = await Note.fromJsonLd({ "@context": [ From c41854577c025fdf2ed801834900b362f7f4be7f Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 06:22:37 +0900 Subject: [PATCH 16/55] Cache remote portable IRI contexts Repeated remote contexts should still contribute aliases to each object that references them. Cache the loaded context body by URL instead of only remembering that the URL was seen, so sibling extension objects can reuse the same @id aliases without another fetch. This also keeps failed custom loaders from crashing the cache scan when they return a nullish remote document. https://github.com/fedify-dev/fedify/pull/850#discussion_r3494738542 https://github.com/fedify-dev/fedify/pull/850#discussion_r3494760231 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 28 ++++---- .../src/__snapshots__/class.test.ts.node.snap | 28 ++++---- .../src/__snapshots__/class.test.ts.snap | 28 ++++---- packages/vocab-tools/src/class.ts | 28 ++++---- packages/vocab/src/vocab.test.ts | 66 +++++++++++++++++++ 5 files changed, 130 insertions(+), 48 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 759126e47..4bd6bbf08 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -113,20 +113,24 @@ async function addRemotePortableIriContextAliases( context: unknown, prefixes: Map, contextLoader: DocumentLoader, - loadedContexts: Set, + loadedContexts: Map, depth = 0, ): Promise { if (depth > 32 || context == null) return; if (typeof context === \\"string\\") { if (context === ACTIVITYSTREAMS_CONTEXT) return; - if (loadedContexts.has(context)) return; - loadedContexts.add(context); - const remoteDocument = await contextLoader(context); - const document = remoteDocument.document; - const remoteContext = document != null && typeof document === \\"object\\" && - \\"@context\\" in document - ? (document as Record)[\\"@context\\"] - : document; + let remoteContext: unknown; + if (loadedContexts.has(context)) { + remoteContext = loadedContexts.get(context); + } else { + const remoteDocument = await contextLoader(context); + const document = remoteDocument?.document; + remoteContext = document != null && typeof document === \\"object\\" && + \\"@context\\" in document + ? (document as Record)[\\"@context\\"] + : document; + loadedContexts.set(context, remoteContext); + } addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); await addRemotePortableIriContextAliases( aliases, @@ -168,7 +172,7 @@ async function getPortableIriKeysWithLoader( object: Record, portableIriKeys: ReadonlySet, contextLoader: DocumentLoader, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise> { if (!(\\"@context\\" in object)) return portableIriKeys; const aliases = new Set(); @@ -265,7 +269,7 @@ async function hasPortableIriWithLoader( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise { if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { @@ -319,7 +323,7 @@ async function normalizePortableIrisWithLoader( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise { if (depth > 32 || key === \\"@context\\") return value; if (typeof value === \\"string\\") { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 738d329dc..440ce25ce 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -111,20 +111,24 @@ async function addRemotePortableIriContextAliases( context: unknown, prefixes: Map, contextLoader: DocumentLoader, - loadedContexts: Set, + loadedContexts: Map, depth = 0, ): Promise { if (depth > 32 || context == null) return; if (typeof context === \\"string\\") { if (context === ACTIVITYSTREAMS_CONTEXT) return; - if (loadedContexts.has(context)) return; - loadedContexts.add(context); - const remoteDocument = await contextLoader(context); - const document = remoteDocument.document; - const remoteContext = document != null && typeof document === \\"object\\" && - \\"@context\\" in document - ? (document as Record)[\\"@context\\"] - : document; + let remoteContext: unknown; + if (loadedContexts.has(context)) { + remoteContext = loadedContexts.get(context); + } else { + const remoteDocument = await contextLoader(context); + const document = remoteDocument?.document; + remoteContext = document != null && typeof document === \\"object\\" && + \\"@context\\" in document + ? (document as Record)[\\"@context\\"] + : document; + loadedContexts.set(context, remoteContext); + } addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); await addRemotePortableIriContextAliases( aliases, @@ -166,7 +170,7 @@ async function getPortableIriKeysWithLoader( object: Record, portableIriKeys: ReadonlySet, contextLoader: DocumentLoader, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise> { if (!(\\"@context\\" in object)) return portableIriKeys; const aliases = new Set(); @@ -263,7 +267,7 @@ async function hasPortableIriWithLoader( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise { if (depth > 32 || key === \\"@context\\") return false; if (typeof value === \\"string\\") { @@ -317,7 +321,7 @@ async function normalizePortableIrisWithLoader( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise { if (depth > 32 || key === \\"@context\\") return value; if (typeof value === \\"string\\") { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index aa91ec6e1..f9f0d8ed2 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -113,20 +113,24 @@ async function addRemotePortableIriContextAliases( context: unknown, prefixes: Map, contextLoader: DocumentLoader, - loadedContexts: Set, + loadedContexts: Map, depth = 0, ): Promise { if (depth > 32 || context == null) return; if (typeof context === "string") { if (context === ACTIVITYSTREAMS_CONTEXT) return; - if (loadedContexts.has(context)) return; - loadedContexts.add(context); - const remoteDocument = await contextLoader(context); - const document = remoteDocument.document; - const remoteContext = document != null && typeof document === "object" && - "@context" in document - ? (document as Record)["@context"] - : document; + let remoteContext: unknown; + if (loadedContexts.has(context)) { + remoteContext = loadedContexts.get(context); + } else { + const remoteDocument = await contextLoader(context); + const document = remoteDocument?.document; + remoteContext = document != null && typeof document === "object" && + "@context" in document + ? (document as Record)["@context"] + : document; + loadedContexts.set(context, remoteContext); + } addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); await addRemotePortableIriContextAliases( aliases, @@ -168,7 +172,7 @@ async function getPortableIriKeysWithLoader( object: Record, portableIriKeys: ReadonlySet, contextLoader: DocumentLoader, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise> { if (!("@context" in object)) return portableIriKeys; const aliases = new Set(); @@ -265,7 +269,7 @@ async function hasPortableIriWithLoader( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise { if (depth > 32 || key === "@context") return false; if (typeof value === "string") { @@ -319,7 +323,7 @@ async function normalizePortableIrisWithLoader( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise { if (depth > 32 || key === "@context") return value; if (typeof value === "string") { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 6e2ebf572..3bf5d37f0 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -328,20 +328,24 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n context: unknown, prefixes: Map, contextLoader: DocumentLoader, - loadedContexts: Set, + loadedContexts: Map, depth = 0, ): Promise { if (depth > 32 || context == null) return; if (typeof context === "string") { if (context === ACTIVITYSTREAMS_CONTEXT) return; - if (loadedContexts.has(context)) return; - loadedContexts.add(context); - const remoteDocument = await contextLoader(context); - const document = remoteDocument.document; - const remoteContext = document != null && typeof document === "object" && - "@context" in document - ? (document as Record)["@context"] - : document; + let remoteContext: unknown; + if (loadedContexts.has(context)) { + remoteContext = loadedContexts.get(context); + } else { + const remoteDocument = await contextLoader(context); + const document = remoteDocument?.document; + remoteContext = document != null && typeof document === "object" && + "@context" in document + ? (document as Record)["@context"] + : document; + loadedContexts.set(context, remoteContext); + } addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); await addRemotePortableIriContextAliases( aliases, @@ -381,7 +385,7 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n object: Record, portableIriKeys: ReadonlySet, contextLoader: DocumentLoader, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise> { if (!("@context" in object)) return portableIriKeys; const aliases = new Set(); @@ -475,7 +479,7 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise { if (depth > 32 || key === "@context") return false; if (typeof value === "string") { @@ -528,7 +532,7 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Set(), + loadedContexts = new Map(), ): Promise { if (depth > 32 || key === "@context") return value; if (typeof value === "string") { diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index f5a3bd89c..7846f3d1c 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -861,6 +861,72 @@ test("fromJsonLd() preserves portable IRIs hidden behind nested remote contexts" }); }); +test("fromJsonLd() reuses remote context aliases for sibling extension objects", async () => { + const rootContextUrl = "https://example.com/contexts/sibling-containers"; + const nestedContextUrl = "https://example.com/contexts/sibling-extra-ref"; + const contextLoader: DocumentLoader = async ( + resource: string, + options, + ): Promise => { + if (resource === rootContextUrl) { + return { + contextUrl: null, + documentUrl: resource, + document: { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + "@vocab": "https://example.com/ns#", + firstExtraContainer: "https://example.com/ns#firstExtraContainer", + secondExtraContainer: + "https://example.com/ns#secondExtraContainer", + }, + ], + }, + }; + } + if (resource === nestedContextUrl) { + return { + contextUrl: null, + documentUrl: resource, + document: { + "@context": { + "@vocab": "https://example.com/ns#", + extraRef: { "@type": "@id" }, + }, + }, + }; + } + return await mockDocumentLoader(resource, options); + }; + const note = await Note.fromJsonLd({ + "@context": rootContextUrl, + type: "Note", + id: "https://example.com/notes/1", + firstExtraContainer: { + "@context": nestedContextUrl, + content: "No portable IRI here.", + }, + secondExtraContainer: { + "@context": nestedContextUrl, + extraRef: "ap://did:key:z6Mkabc/second", + }, + }, { documentLoader: mockDocumentLoader, contextLoader }); + + const jsonLd = await note.toJsonLd({ contextLoader }) as Record< + string, + unknown + >; + deepStrictEqual(jsonLd.firstExtraContainer, { + "@context": nestedContextUrl, + content: "No portable IRI here.", + }); + deepStrictEqual(jsonLd.secondExtraContainer, { + "@context": nestedContextUrl, + extraRef: "ap+ef61://did:key:z6Mkabc/second", + }); +}); + test("fromJsonLd() formats portable IRIs in scalar URL values", async () => { const note = await Note.fromJsonLd({ "@context": [ From 00be738b8a32fc652cb636760fb6bbe093c2802a Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 08:51:42 +0900 Subject: [PATCH 17/55] Normalize expanded portable IRI values Portable IRI cache normalization should not reimplement JSON-LD context handling over compact input. Normalize the expanded values produced by the JSON-LD processor, then compact them with the input context when one was supplied, so extension data is kept without a parallel context resolver. https://github.com/fedify-dev/fedify/pull/850 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 2121 +++++++++-------- .../src/__snapshots__/class.test.ts.node.snap | 2121 +++++++++-------- .../src/__snapshots__/class.test.ts.snap | 2121 +++++++++-------- packages/vocab-tools/src/class.ts | 249 +- packages/vocab-tools/src/codec.ts | 23 +- packages/vocab/src/vocab.test.ts | 19 +- 6 files changed, 3431 insertions(+), 3223 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 4bd6bbf08..e74456718 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -34,9 +34,6 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -const ACTIVITYSTREAMS_CONTEXT = \\"https://www.w3.org/ns/activitystreams\\"; -const ACTIVITYSTREAMS_IRI_PREFIX = \\"https://www.w3.org/ns/activitystreams#\\"; - function isPortableIriPosition( key: string, parentKey?: string, @@ -47,148 +44,6 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } -function addContextIriPrefix( - prefixes: Map, - term: string, - iri: string, -): void { - if (!iri.endsWith(\\"#\\") && !iri.endsWith(\\"/\\") && !iri.endsWith(\\":\\")) return; - prefixes.set(term, iri); -} - -function expandContextIri( - iri: string, - prefixes: ReadonlyMap, -): string { - const separatorIndex = iri.indexOf(\\":\\"); - if (separatorIndex < 1) return iri; - const prefix = prefixes.get(iri.slice(0, separatorIndex)); - if (prefix == null) return iri; - return prefix + iri.slice(separatorIndex + 1); -} - -function addPortableIriContextAliases( - aliases: Set, - context: unknown, - prefixes: Map, - depth = 0, -): void { - if (depth > 32 || context == null) return; - if (context === ACTIVITYSTREAMS_CONTEXT) { - prefixes.set(\\"as\\", ACTIVITYSTREAMS_IRI_PREFIX); - return; - } - if (Array.isArray(context)) { - for (const entry of context) { - addPortableIriContextAliases(aliases, entry, prefixes, depth + 1); - } - return; - } - if (typeof context !== \\"object\\") return; - const object = context as Record; - for (const [term, definition] of globalThis.Object.entries(object)) { - if (typeof definition === \\"string\\") { - const expandedDefinition = expandContextIri(definition, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedDefinition)) aliases.add(term); - addContextIriPrefix(prefixes, term, expandedDefinition); - continue; - } - if (definition == null || typeof definition !== \\"object\\") continue; - if ((definition as Record)[\\"@type\\"] === \\"@id\\") { - aliases.add(term); - } - const id = (definition as Record)[\\"@id\\"]; - if (typeof id === \\"string\\") { - const expandedId = expandContextIri(id, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); - if ((definition as Record)[\\"@prefix\\"] === true) { - addContextIriPrefix(prefixes, term, expandedId); - } - } - } -} - -async function addRemotePortableIriContextAliases( - aliases: Set, - context: unknown, - prefixes: Map, - contextLoader: DocumentLoader, - loadedContexts: Map, - depth = 0, -): Promise { - if (depth > 32 || context == null) return; - if (typeof context === \\"string\\") { - if (context === ACTIVITYSTREAMS_CONTEXT) return; - let remoteContext: unknown; - if (loadedContexts.has(context)) { - remoteContext = loadedContexts.get(context); - } else { - const remoteDocument = await contextLoader(context); - const document = remoteDocument?.document; - remoteContext = document != null && typeof document === \\"object\\" && - \\"@context\\" in document - ? (document as Record)[\\"@context\\"] - : document; - loadedContexts.set(context, remoteContext); - } - addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); - await addRemotePortableIriContextAliases( - aliases, - remoteContext, - prefixes, - contextLoader, - loadedContexts, - depth + 1, - ); - return; - } - if (Array.isArray(context)) { - for (const entry of context) { - await addRemotePortableIriContextAliases( - aliases, - entry, - prefixes, - contextLoader, - loadedContexts, - depth + 1, - ); - } - } -} - -function getPortableIriKeys( - object: Record, - portableIriKeys: ReadonlySet, -): ReadonlySet { - if (!(\\"@context\\" in object)) return portableIriKeys; - const aliases = new Set(); - const prefixes = new Map(); - addPortableIriContextAliases(aliases, object[\\"@context\\"], prefixes); - if (aliases.size < 1) return portableIriKeys; - return new Set([...portableIriKeys, ...aliases]); -} - -async function getPortableIriKeysWithLoader( - object: Record, - portableIriKeys: ReadonlySet, - contextLoader: DocumentLoader, - loadedContexts = new Map(), -): Promise> { - if (!(\\"@context\\" in object)) return portableIriKeys; - const aliases = new Set(); - const prefixes = new Map(); - addPortableIriContextAliases(aliases, object[\\"@context\\"], prefixes); - await addRemotePortableIriContextAliases( - aliases, - object[\\"@context\\"], - prefixes, - contextLoader, - loadedContexts, - ); - if (aliases.size < 1) return portableIriKeys; - return new Set([...portableIriKeys, ...aliases]); -} - function hasPortableIri( value: unknown, key?: string, @@ -208,14 +63,13 @@ function hasPortableIri( } if (value == null || typeof value !== \\"object\\") return false; const object = value as Record; - const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); return globalThis.Object.keys(object).some((entryKey) => hasPortableIri( object[entryKey], entryKey, depth + 1, key, - nextPortableIriKeys, + portableIriKeys, ) ); } @@ -249,121 +103,13 @@ function normalizePortableIris( } if (value == null || typeof value !== \\"object\\") return value; const object = value as Record; - const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); for (const entryKey of globalThis.Object.keys(object)) { object[entryKey] = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, - nextPortableIriKeys, - ); - } - return object; -} - -async function hasPortableIriWithLoader( - value: unknown, - contextLoader: DocumentLoader, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Map(), -): Promise { - if (depth > 32 || key === \\"@context\\") return false; - if (typeof value === \\"string\\") { - return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value); - } - if (Array.isArray(value)) { - for (const item of value) { - if ( - await hasPortableIriWithLoader( - item, - contextLoader, - key, - depth + 1, - parentKey, - portableIriKeys, - loadedContexts, - ) - ) return true; - } - return false; - } - if (value == null || typeof value !== \\"object\\") return false; - const object = value as Record; - const nextPortableIriKeys = await getPortableIriKeysWithLoader( - object, - portableIriKeys, - contextLoader, - loadedContexts, - ); - for (const entryKey of globalThis.Object.keys(object)) { - if ( - await hasPortableIriWithLoader( - object[entryKey], - contextLoader, - entryKey, - depth + 1, - key, - nextPortableIriKeys, - loadedContexts, - ) - ) return true; - } - return false; -} - -async function normalizePortableIrisWithLoader( - value: unknown, - contextLoader: DocumentLoader, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Map(), -): Promise { - if (depth > 32 || key === \\"@context\\") return value; - if (typeof value === \\"string\\") { - return key != null && - isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ? formatIri(value) - : value; - } - if (Array.isArray(value)) { - for (let i = 0; i < value.length; i++) { - value[i] = await normalizePortableIrisWithLoader( - value[i], - contextLoader, - key, - depth + 1, - parentKey, - portableIriKeys, - loadedContexts, - ); - } - return value; - } - if (value == null || typeof value !== \\"object\\") return value; - const object = value as Record; - const nextPortableIriKeys = await getPortableIriKeysWithLoader( - object, - portableIriKeys, - contextLoader, - loadedContexts, - ); - for (const entryKey of globalThis.Object.keys(object)) { - object[entryKey] = await normalizePortableIrisWithLoader( - object[entryKey], - contextLoader, - entryKey, - depth + 1, - key, - nextPortableIriKeys, - loadedContexts, + portableIriKeys, ); } return object; @@ -10947,6 +10693,7 @@ get urls(): ((URL | Link))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -12352,15 +12099,19 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -13536,6 +13287,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -13560,15 +13312,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -14568,6 +14324,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -14678,15 +14435,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -17715,6 +17476,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18075,15 +17837,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -18552,6 +18318,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18576,15 +18343,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -19074,6 +18845,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19141,15 +18913,19 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -19679,6 +19455,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19734,15 +19511,19 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -20704,6 +20485,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20788,15 +20570,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -21159,6 +20945,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -21183,15 +20970,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -21769,6 +21560,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -21872,15 +21664,19 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -22536,6 +22332,7 @@ get manualApprovals(): (URL)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -22591,15 +22388,19 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -23572,6 +23373,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23656,15 +23458,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -24026,6 +23832,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -24050,15 +23857,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -24964,6 +24775,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -25048,15 +24860,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -25418,6 +25234,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -25442,15 +25259,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26355,6 +26176,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26439,15 +26261,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26809,6 +26635,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26833,15 +26660,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -27273,6 +27104,7 @@ get endpoints(): (URL)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27314,15 +27146,19 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -27623,6 +27459,7 @@ endpoints?: (URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27647,15 +27484,19 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -28460,6 +28301,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -28585,15 +28427,19 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -29452,6 +29298,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -29539,15 +29386,19 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -30357,6 +30208,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30444,15 +30296,19 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -30992,6 +30848,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -31058,15 +30915,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -31590,6 +31451,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -31648,15 +31510,19 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -32412,6 +32278,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -32530,15 +32397,19 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33281,6 +33152,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33383,15 +33255,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33786,6 +33662,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33814,15 +33691,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -34138,6 +34019,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -34162,15 +34044,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -34485,6 +34371,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -34509,15 +34396,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -40197,6 +40088,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -40838,15 +40730,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -41633,6 +41529,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41669,15 +41566,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -41992,6 +41893,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -42016,15 +41918,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43019,6 +42925,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -43129,15 +43036,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43666,6 +43577,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -43742,15 +43654,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -44107,6 +44023,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44131,15 +44048,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -44453,6 +44374,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44481,15 +44403,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -44805,6 +44731,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44829,15 +44756,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -48748,6 +48679,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -49172,15 +49104,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -50632,6 +50568,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -50750,15 +50687,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -51130,6 +51071,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51154,15 +51096,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -51476,6 +51422,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51500,15 +51447,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -51820,6 +51771,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51844,15 +51796,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -52633,6 +52589,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -52760,15 +52717,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -53220,6 +53181,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53244,15 +53206,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -53567,6 +53533,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53591,15 +53558,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -53915,6 +53886,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53939,15 +53911,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -59627,6 +59603,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -60268,15 +60245,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62047,6 +62028,7 @@ get names(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62246,15 +62228,19 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62724,6 +62710,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62748,15 +62735,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63073,6 +63064,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63097,15 +63089,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63420,6 +63416,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63448,15 +63445,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63770,6 +63771,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63794,15 +63796,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64116,6 +64122,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64140,15 +64147,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64462,6 +64473,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64486,15 +64498,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64808,6 +64824,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64832,15 +64849,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -65152,6 +65173,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65176,15 +65198,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -65462,6 +65488,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65486,15 +65513,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -65809,6 +65840,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65833,15 +65865,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -66838,6 +66874,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -66948,15 +66985,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -67651,6 +67692,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -67715,15 +67757,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -68457,6 +68503,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -68539,15 +68586,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -74269,6 +74320,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -74910,15 +74962,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -75707,6 +75763,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -75731,15 +75788,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -81419,6 +81480,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -82060,15 +82122,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -83313,6 +83379,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -83451,15 +83518,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -84192,6 +84263,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -84246,15 +84318,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -85900,6 +85976,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86119,15 +86196,19 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -86584,6 +86665,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86608,15 +86690,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -86930,6 +87016,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86958,15 +87045,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -88493,6 +88584,7 @@ relationships?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -88607,15 +88699,19 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -89001,6 +89097,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -89025,15 +89122,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -94713,6 +94814,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -95354,15 +95456,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96367,6 +96473,7 @@ get contents(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -96428,15 +96535,19 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96811,6 +96922,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -96835,15 +96947,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -97157,6 +97273,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -97181,15 +97298,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -97719,6 +97840,7 @@ get formerTypes(): (\$EntityType)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -97796,15 +97918,19 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98166,6 +98292,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98190,15 +98317,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98517,6 +98648,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98541,15 +98673,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98866,6 +99002,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98890,15 +99027,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -99215,6 +99356,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -99239,15 +99381,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -99560,6 +99706,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -99584,15 +99731,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 440ce25ce..952de4d11 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -32,9 +32,6 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -const ACTIVITYSTREAMS_CONTEXT = \\"https://www.w3.org/ns/activitystreams\\"; -const ACTIVITYSTREAMS_IRI_PREFIX = \\"https://www.w3.org/ns/activitystreams#\\"; - function isPortableIriPosition( key: string, parentKey?: string, @@ -45,148 +42,6 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } -function addContextIriPrefix( - prefixes: Map, - term: string, - iri: string, -): void { - if (!iri.endsWith(\\"#\\") && !iri.endsWith(\\"/\\") && !iri.endsWith(\\":\\")) return; - prefixes.set(term, iri); -} - -function expandContextIri( - iri: string, - prefixes: ReadonlyMap, -): string { - const separatorIndex = iri.indexOf(\\":\\"); - if (separatorIndex < 1) return iri; - const prefix = prefixes.get(iri.slice(0, separatorIndex)); - if (prefix == null) return iri; - return prefix + iri.slice(separatorIndex + 1); -} - -function addPortableIriContextAliases( - aliases: Set, - context: unknown, - prefixes: Map, - depth = 0, -): void { - if (depth > 32 || context == null) return; - if (context === ACTIVITYSTREAMS_CONTEXT) { - prefixes.set(\\"as\\", ACTIVITYSTREAMS_IRI_PREFIX); - return; - } - if (Array.isArray(context)) { - for (const entry of context) { - addPortableIriContextAliases(aliases, entry, prefixes, depth + 1); - } - return; - } - if (typeof context !== \\"object\\") return; - const object = context as Record; - for (const [term, definition] of globalThis.Object.entries(object)) { - if (typeof definition === \\"string\\") { - const expandedDefinition = expandContextIri(definition, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedDefinition)) aliases.add(term); - addContextIriPrefix(prefixes, term, expandedDefinition); - continue; - } - if (definition == null || typeof definition !== \\"object\\") continue; - if ((definition as Record)[\\"@type\\"] === \\"@id\\") { - aliases.add(term); - } - const id = (definition as Record)[\\"@id\\"]; - if (typeof id === \\"string\\") { - const expandedId = expandContextIri(id, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); - if ((definition as Record)[\\"@prefix\\"] === true) { - addContextIriPrefix(prefixes, term, expandedId); - } - } - } -} - -async function addRemotePortableIriContextAliases( - aliases: Set, - context: unknown, - prefixes: Map, - contextLoader: DocumentLoader, - loadedContexts: Map, - depth = 0, -): Promise { - if (depth > 32 || context == null) return; - if (typeof context === \\"string\\") { - if (context === ACTIVITYSTREAMS_CONTEXT) return; - let remoteContext: unknown; - if (loadedContexts.has(context)) { - remoteContext = loadedContexts.get(context); - } else { - const remoteDocument = await contextLoader(context); - const document = remoteDocument?.document; - remoteContext = document != null && typeof document === \\"object\\" && - \\"@context\\" in document - ? (document as Record)[\\"@context\\"] - : document; - loadedContexts.set(context, remoteContext); - } - addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); - await addRemotePortableIriContextAliases( - aliases, - remoteContext, - prefixes, - contextLoader, - loadedContexts, - depth + 1, - ); - return; - } - if (Array.isArray(context)) { - for (const entry of context) { - await addRemotePortableIriContextAliases( - aliases, - entry, - prefixes, - contextLoader, - loadedContexts, - depth + 1, - ); - } - } -} - -function getPortableIriKeys( - object: Record, - portableIriKeys: ReadonlySet, -): ReadonlySet { - if (!(\\"@context\\" in object)) return portableIriKeys; - const aliases = new Set(); - const prefixes = new Map(); - addPortableIriContextAliases(aliases, object[\\"@context\\"], prefixes); - if (aliases.size < 1) return portableIriKeys; - return new Set([...portableIriKeys, ...aliases]); -} - -async function getPortableIriKeysWithLoader( - object: Record, - portableIriKeys: ReadonlySet, - contextLoader: DocumentLoader, - loadedContexts = new Map(), -): Promise> { - if (!(\\"@context\\" in object)) return portableIriKeys; - const aliases = new Set(); - const prefixes = new Map(); - addPortableIriContextAliases(aliases, object[\\"@context\\"], prefixes); - await addRemotePortableIriContextAliases( - aliases, - object[\\"@context\\"], - prefixes, - contextLoader, - loadedContexts, - ); - if (aliases.size < 1) return portableIriKeys; - return new Set([...portableIriKeys, ...aliases]); -} - function hasPortableIri( value: unknown, key?: string, @@ -206,14 +61,13 @@ function hasPortableIri( } if (value == null || typeof value !== \\"object\\") return false; const object = value as Record; - const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); return globalThis.Object.keys(object).some((entryKey) => hasPortableIri( object[entryKey], entryKey, depth + 1, key, - nextPortableIriKeys, + portableIriKeys, ) ); } @@ -247,121 +101,13 @@ function normalizePortableIris( } if (value == null || typeof value !== \\"object\\") return value; const object = value as Record; - const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); for (const entryKey of globalThis.Object.keys(object)) { object[entryKey] = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, - nextPortableIriKeys, - ); - } - return object; -} - -async function hasPortableIriWithLoader( - value: unknown, - contextLoader: DocumentLoader, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Map(), -): Promise { - if (depth > 32 || key === \\"@context\\") return false; - if (typeof value === \\"string\\") { - return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value); - } - if (Array.isArray(value)) { - for (const item of value) { - if ( - await hasPortableIriWithLoader( - item, - contextLoader, - key, - depth + 1, - parentKey, - portableIriKeys, - loadedContexts, - ) - ) return true; - } - return false; - } - if (value == null || typeof value !== \\"object\\") return false; - const object = value as Record; - const nextPortableIriKeys = await getPortableIriKeysWithLoader( - object, - portableIriKeys, - contextLoader, - loadedContexts, - ); - for (const entryKey of globalThis.Object.keys(object)) { - if ( - await hasPortableIriWithLoader( - object[entryKey], - contextLoader, - entryKey, - depth + 1, - key, - nextPortableIriKeys, - loadedContexts, - ) - ) return true; - } - return false; -} - -async function normalizePortableIrisWithLoader( - value: unknown, - contextLoader: DocumentLoader, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Map(), -): Promise { - if (depth > 32 || key === \\"@context\\") return value; - if (typeof value === \\"string\\") { - return key != null && - isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ? formatIri(value) - : value; - } - if (Array.isArray(value)) { - for (let i = 0; i < value.length; i++) { - value[i] = await normalizePortableIrisWithLoader( - value[i], - contextLoader, - key, - depth + 1, - parentKey, - portableIriKeys, - loadedContexts, - ); - } - return value; - } - if (value == null || typeof value !== \\"object\\") return value; - const object = value as Record; - const nextPortableIriKeys = await getPortableIriKeysWithLoader( - object, - portableIriKeys, - contextLoader, - loadedContexts, - ); - for (const entryKey of globalThis.Object.keys(object)) { - object[entryKey] = await normalizePortableIrisWithLoader( - object[entryKey], - contextLoader, - entryKey, - depth + 1, - key, - nextPortableIriKeys, - loadedContexts, + portableIriKeys, ); } return object; @@ -10945,6 +10691,7 @@ get urls(): ((URL | Link))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -12350,15 +12097,19 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -13534,6 +13285,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -13558,15 +13310,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -14566,6 +14322,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -14676,15 +14433,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -17713,6 +17474,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18073,15 +17835,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -18550,6 +18316,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18574,15 +18341,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -19072,6 +18843,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19139,15 +18911,19 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -19677,6 +19453,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19732,15 +19509,19 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -20702,6 +20483,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20786,15 +20568,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -21157,6 +20943,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -21181,15 +20968,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -21767,6 +21558,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -21870,15 +21662,19 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -22534,6 +22330,7 @@ get manualApprovals(): (URL)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -22589,15 +22386,19 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -23570,6 +23371,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23654,15 +23456,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -24024,6 +23830,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -24048,15 +23855,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -24962,6 +24773,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -25046,15 +24858,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -25416,6 +25232,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -25440,15 +25257,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26353,6 +26174,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26437,15 +26259,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -26807,6 +26633,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26831,15 +26658,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -27271,6 +27102,7 @@ get endpoints(): (URL)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27312,15 +27144,19 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -27621,6 +27457,7 @@ endpoints?: (URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27645,15 +27482,19 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -28458,6 +28299,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -28583,15 +28425,19 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -29450,6 +29296,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -29537,15 +29384,19 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -30355,6 +30206,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30442,15 +30294,19 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -30990,6 +30846,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -31056,15 +30913,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -31588,6 +31449,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -31646,15 +31508,19 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -32410,6 +32276,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -32528,15 +32395,19 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33279,6 +33150,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33381,15 +33253,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -33784,6 +33660,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33812,15 +33689,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -34136,6 +34017,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -34160,15 +34042,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -34483,6 +34369,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -34507,15 +34394,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -40195,6 +40086,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -40836,15 +40728,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -41631,6 +41527,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41667,15 +41564,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -41990,6 +41891,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -42014,15 +41916,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43017,6 +42923,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -43127,15 +43034,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -43664,6 +43575,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -43740,15 +43652,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -44105,6 +44021,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44129,15 +44046,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -44451,6 +44372,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44479,15 +44401,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -44803,6 +44729,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44827,15 +44754,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -48746,6 +48677,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -49170,15 +49102,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -50630,6 +50566,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -50748,15 +50685,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -51128,6 +51069,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51152,15 +51094,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -51474,6 +51420,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51498,15 +51445,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -51818,6 +51769,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51842,15 +51794,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -52631,6 +52587,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -52758,15 +52715,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -53218,6 +53179,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53242,15 +53204,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -53565,6 +53531,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53589,15 +53556,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -53913,6 +53884,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53937,15 +53909,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -59625,6 +59601,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -60266,15 +60243,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62045,6 +62026,7 @@ get names(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62244,15 +62226,19 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -62722,6 +62708,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62746,15 +62733,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63071,6 +63062,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63095,15 +63087,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63418,6 +63414,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63446,15 +63443,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -63768,6 +63769,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63792,15 +63794,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64114,6 +64120,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64138,15 +64145,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64460,6 +64471,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64484,15 +64496,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -64806,6 +64822,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64830,15 +64847,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -65150,6 +65171,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65174,15 +65196,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -65460,6 +65486,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65484,15 +65511,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -65807,6 +65838,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65831,15 +65863,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -66836,6 +66872,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -66946,15 +66983,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -67649,6 +67690,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -67713,15 +67755,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -68455,6 +68501,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -68537,15 +68584,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -74267,6 +74318,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -74908,15 +74960,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -75705,6 +75761,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -75729,15 +75786,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -81417,6 +81478,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -82058,15 +82120,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -83311,6 +83377,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -83449,15 +83516,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -84190,6 +84261,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -84244,15 +84316,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -85898,6 +85974,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86117,15 +86194,19 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -86582,6 +86663,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86606,15 +86688,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -86928,6 +87014,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86956,15 +87043,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -88491,6 +88582,7 @@ relationships?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -88605,15 +88697,19 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -88999,6 +89095,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -89023,15 +89120,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -94711,6 +94812,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -95352,15 +95454,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96365,6 +96471,7 @@ get contents(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -96426,15 +96533,19 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -96809,6 +96920,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -96833,15 +96945,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -97155,6 +97271,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -97179,15 +97296,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -97717,6 +97838,7 @@ get formerTypes(): ($EntityType)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -97794,15 +97916,19 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98164,6 +98290,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98188,15 +98315,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98515,6 +98646,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98539,15 +98671,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -98864,6 +99000,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98888,15 +99025,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -99213,6 +99354,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -99237,15 +99379,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( @@ -99558,6 +99704,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } + const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -99582,15 +99729,19 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === \\"object\\" && + \\"@context\\" in json + ? (json as Record)[\\"@context\\"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger([\\"fedify\\", \\"vocab\\"]).warn( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index f9f0d8ed2..cf4fd188e 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -34,9 +34,6 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","_misskey_quote","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","quoteUri","quoteUrl","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); -const ACTIVITYSTREAMS_CONTEXT = "https://www.w3.org/ns/activitystreams"; -const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#"; - function isPortableIriPosition( key: string, parentKey?: string, @@ -47,148 +44,6 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } -function addContextIriPrefix( - prefixes: Map, - term: string, - iri: string, -): void { - if (!iri.endsWith("#") && !iri.endsWith("/") && !iri.endsWith(":")) return; - prefixes.set(term, iri); -} - -function expandContextIri( - iri: string, - prefixes: ReadonlyMap, -): string { - const separatorIndex = iri.indexOf(":"); - if (separatorIndex < 1) return iri; - const prefix = prefixes.get(iri.slice(0, separatorIndex)); - if (prefix == null) return iri; - return prefix + iri.slice(separatorIndex + 1); -} - -function addPortableIriContextAliases( - aliases: Set, - context: unknown, - prefixes: Map, - depth = 0, -): void { - if (depth > 32 || context == null) return; - if (context === ACTIVITYSTREAMS_CONTEXT) { - prefixes.set("as", ACTIVITYSTREAMS_IRI_PREFIX); - return; - } - if (Array.isArray(context)) { - for (const entry of context) { - addPortableIriContextAliases(aliases, entry, prefixes, depth + 1); - } - return; - } - if (typeof context !== "object") return; - const object = context as Record; - for (const [term, definition] of globalThis.Object.entries(object)) { - if (typeof definition === "string") { - const expandedDefinition = expandContextIri(definition, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedDefinition)) aliases.add(term); - addContextIriPrefix(prefixes, term, expandedDefinition); - continue; - } - if (definition == null || typeof definition !== "object") continue; - if ((definition as Record)["@type"] === "@id") { - aliases.add(term); - } - const id = (definition as Record)["@id"]; - if (typeof id === "string") { - const expandedId = expandContextIri(id, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); - if ((definition as Record)["@prefix"] === true) { - addContextIriPrefix(prefixes, term, expandedId); - } - } - } -} - -async function addRemotePortableIriContextAliases( - aliases: Set, - context: unknown, - prefixes: Map, - contextLoader: DocumentLoader, - loadedContexts: Map, - depth = 0, -): Promise { - if (depth > 32 || context == null) return; - if (typeof context === "string") { - if (context === ACTIVITYSTREAMS_CONTEXT) return; - let remoteContext: unknown; - if (loadedContexts.has(context)) { - remoteContext = loadedContexts.get(context); - } else { - const remoteDocument = await contextLoader(context); - const document = remoteDocument?.document; - remoteContext = document != null && typeof document === "object" && - "@context" in document - ? (document as Record)["@context"] - : document; - loadedContexts.set(context, remoteContext); - } - addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); - await addRemotePortableIriContextAliases( - aliases, - remoteContext, - prefixes, - contextLoader, - loadedContexts, - depth + 1, - ); - return; - } - if (Array.isArray(context)) { - for (const entry of context) { - await addRemotePortableIriContextAliases( - aliases, - entry, - prefixes, - contextLoader, - loadedContexts, - depth + 1, - ); - } - } -} - -function getPortableIriKeys( - object: Record, - portableIriKeys: ReadonlySet, -): ReadonlySet { - if (!("@context" in object)) return portableIriKeys; - const aliases = new Set(); - const prefixes = new Map(); - addPortableIriContextAliases(aliases, object["@context"], prefixes); - if (aliases.size < 1) return portableIriKeys; - return new Set([...portableIriKeys, ...aliases]); -} - -async function getPortableIriKeysWithLoader( - object: Record, - portableIriKeys: ReadonlySet, - contextLoader: DocumentLoader, - loadedContexts = new Map(), -): Promise> { - if (!("@context" in object)) return portableIriKeys; - const aliases = new Set(); - const prefixes = new Map(); - addPortableIriContextAliases(aliases, object["@context"], prefixes); - await addRemotePortableIriContextAliases( - aliases, - object["@context"], - prefixes, - contextLoader, - loadedContexts, - ); - if (aliases.size < 1) return portableIriKeys; - return new Set([...portableIriKeys, ...aliases]); -} - function hasPortableIri( value: unknown, key?: string, @@ -208,14 +63,13 @@ function hasPortableIri( } if (value == null || typeof value !== "object") return false; const object = value as Record; - const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); return globalThis.Object.keys(object).some((entryKey) => hasPortableIri( object[entryKey], entryKey, depth + 1, key, - nextPortableIriKeys, + portableIriKeys, ) ); } @@ -249,121 +103,13 @@ function normalizePortableIris( } if (value == null || typeof value !== "object") return value; const object = value as Record; - const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); for (const entryKey of globalThis.Object.keys(object)) { object[entryKey] = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, - nextPortableIriKeys, - ); - } - return object; -} - -async function hasPortableIriWithLoader( - value: unknown, - contextLoader: DocumentLoader, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Map(), -): Promise { - if (depth > 32 || key === "@context") return false; - if (typeof value === "string") { - return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value); - } - if (Array.isArray(value)) { - for (const item of value) { - if ( - await hasPortableIriWithLoader( - item, - contextLoader, - key, - depth + 1, - parentKey, - portableIriKeys, - loadedContexts, - ) - ) return true; - } - return false; - } - if (value == null || typeof value !== "object") return false; - const object = value as Record; - const nextPortableIriKeys = await getPortableIriKeysWithLoader( - object, - portableIriKeys, - contextLoader, - loadedContexts, - ); - for (const entryKey of globalThis.Object.keys(object)) { - if ( - await hasPortableIriWithLoader( - object[entryKey], - contextLoader, - entryKey, - depth + 1, - key, - nextPortableIriKeys, - loadedContexts, - ) - ) return true; - } - return false; -} - -async function normalizePortableIrisWithLoader( - value: unknown, - contextLoader: DocumentLoader, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Map(), -): Promise { - if (depth > 32 || key === "@context") return value; - if (typeof value === "string") { - return key != null && - isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ? formatIri(value) - : value; - } - if (Array.isArray(value)) { - for (let i = 0; i < value.length; i++) { - value[i] = await normalizePortableIrisWithLoader( - value[i], - contextLoader, - key, - depth + 1, - parentKey, - portableIriKeys, - loadedContexts, - ); - } - return value; - } - if (value == null || typeof value !== "object") return value; - const object = value as Record; - const nextPortableIriKeys = await getPortableIriKeysWithLoader( - object, - portableIriKeys, - contextLoader, - loadedContexts, - ); - for (const entryKey of globalThis.Object.keys(object)) { - object[entryKey] = await normalizePortableIrisWithLoader( - object[entryKey], - contextLoader, - entryKey, - depth + 1, - key, - nextPortableIriKeys, - loadedContexts, + portableIriKeys, ); } return object; @@ -10947,6 +10693,7 @@ get urls(): ((URL | Link))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -12352,15 +12099,19 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -13536,6 +13287,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -13560,15 +13312,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -14568,6 +14324,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -14678,15 +14435,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -17715,6 +17476,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -18075,15 +17837,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -18552,6 +18318,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -18576,15 +18343,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -19074,6 +18845,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -19141,15 +18913,19 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -19679,6 +19455,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -19734,15 +19511,19 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -20704,6 +20485,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -20788,15 +20570,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -21159,6 +20945,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -21183,15 +20970,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -21769,6 +21560,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -21872,15 +21664,19 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -22536,6 +22332,7 @@ get manualApprovals(): (URL)[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -22591,15 +22388,19 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -23572,6 +23373,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -23656,15 +23458,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -24026,6 +23832,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -24050,15 +23857,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -24964,6 +24775,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -25048,15 +24860,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -25418,6 +25234,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -25442,15 +25259,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -26355,6 +26176,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -26439,15 +26261,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -26809,6 +26635,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -26833,15 +26660,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -27273,6 +27104,7 @@ get endpoints(): (URL)[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -27314,15 +27146,19 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -27623,6 +27459,7 @@ endpoints?: (URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -27647,15 +27484,19 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -28460,6 +28301,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -28585,15 +28427,19 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -29452,6 +29298,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -29539,15 +29386,19 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -30357,6 +30208,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -30444,15 +30296,19 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -30992,6 +30848,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -31058,15 +30915,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -31590,6 +31451,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -31648,15 +31510,19 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -32412,6 +32278,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -32530,15 +32397,19 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -33281,6 +33152,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -33383,15 +33255,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -33786,6 +33662,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -33814,15 +33691,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -34138,6 +34019,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -34162,15 +34044,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -34485,6 +34371,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -34509,15 +34396,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -40197,6 +40088,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -40838,15 +40730,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -41633,6 +41529,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -41669,15 +41566,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -41992,6 +41893,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -42016,15 +41918,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -43019,6 +42925,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -43129,15 +43036,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -43666,6 +43577,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -43742,15 +43654,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -44107,6 +44023,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -44131,15 +44048,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -44453,6 +44374,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -44481,15 +44403,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -44805,6 +44731,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -44829,15 +44756,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -48748,6 +48679,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -49172,15 +49104,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -50632,6 +50568,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -50750,15 +50687,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -51130,6 +51071,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -51154,15 +51096,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -51476,6 +51422,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -51500,15 +51447,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -51820,6 +51771,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -51844,15 +51796,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -52633,6 +52589,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -52760,15 +52717,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -53220,6 +53181,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -53244,15 +53206,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -53567,6 +53533,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -53591,15 +53558,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -53915,6 +53886,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -53939,15 +53911,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -59627,6 +59603,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -60268,15 +60245,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -62047,6 +62028,7 @@ get names(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -62246,15 +62228,19 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -62724,6 +62710,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -62748,15 +62735,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -63073,6 +63064,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -63097,15 +63089,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -63420,6 +63416,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -63448,15 +63445,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -63770,6 +63771,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -63794,15 +63796,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -64116,6 +64122,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -64140,15 +64147,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -64462,6 +64473,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -64486,15 +64498,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -64808,6 +64824,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -64832,15 +64849,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -65152,6 +65173,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -65176,15 +65198,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -65462,6 +65488,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -65486,15 +65513,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -65809,6 +65840,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -65833,15 +65865,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -66838,6 +66874,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -66948,15 +66985,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -67651,6 +67692,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -67715,15 +67757,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -68457,6 +68503,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -68539,15 +68586,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -74269,6 +74320,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -74910,15 +74962,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -75707,6 +75763,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -75731,15 +75788,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -81419,6 +81480,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -82060,15 +82122,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -83313,6 +83379,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -83451,15 +83518,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -84192,6 +84263,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -84246,15 +84318,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -85900,6 +85976,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -86119,15 +86196,19 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -86584,6 +86665,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -86608,15 +86690,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -86930,6 +87016,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -86958,15 +87045,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -88493,6 +88584,7 @@ relationships?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -88607,15 +88699,19 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -89001,6 +89097,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -89025,15 +89122,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -94713,6 +94814,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -95354,15 +95456,19 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -96367,6 +96473,7 @@ get contents(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -96428,15 +96535,19 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -96811,6 +96922,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -96835,15 +96947,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -97157,6 +97273,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -97181,15 +97298,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -97719,6 +97840,7 @@ get formerTypes(): ($EntityType)[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -97796,15 +97918,19 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -98166,6 +98292,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -98190,15 +98317,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -98517,6 +98648,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -98541,15 +98673,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -98866,6 +99002,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -98890,15 +99027,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -99215,6 +99356,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -99239,15 +99381,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( @@ -99560,6 +99706,7 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -99584,15 +99731,19 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 3bf5d37f0..03ba5646e 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -254,8 +254,6 @@ export async function* generateClasses( yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ JSON.stringify([...portableIriKeys].sort()) });\n\n`; - yield `const ACTIVITYSTREAMS_CONTEXT = "https://www.w3.org/ns/activitystreams"; -const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n`; yield `function isPortableIriPosition( key: string, parentKey?: string, @@ -264,142 +262,6 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n return portableIriKeys.has(key) || ((key === "@value" || key === "@list" || key === "@set") && parentKey != null && portableIriKeys.has(parentKey)); -}\n\n`; - yield `function addContextIriPrefix( - prefixes: Map, - term: string, - iri: string, -): void { - if (!iri.endsWith("#") && !iri.endsWith("/") && !iri.endsWith(":")) return; - prefixes.set(term, iri); -}\n\n`; - yield `function expandContextIri( - iri: string, - prefixes: ReadonlyMap, -): string { - const separatorIndex = iri.indexOf(":"); - if (separatorIndex < 1) return iri; - const prefix = prefixes.get(iri.slice(0, separatorIndex)); - if (prefix == null) return iri; - return prefix + iri.slice(separatorIndex + 1); -}\n\n`; - yield `function addPortableIriContextAliases( - aliases: Set, - context: unknown, - prefixes: Map, - depth = 0, -): void { - if (depth > 32 || context == null) return; - if (context === ACTIVITYSTREAMS_CONTEXT) { - prefixes.set("as", ACTIVITYSTREAMS_IRI_PREFIX); - return; - } - if (Array.isArray(context)) { - for (const entry of context) { - addPortableIriContextAliases(aliases, entry, prefixes, depth + 1); - } - return; - } - if (typeof context !== "object") return; - const object = context as Record; - for (const [term, definition] of globalThis.Object.entries(object)) { - if (typeof definition === "string") { - const expandedDefinition = expandContextIri(definition, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedDefinition)) aliases.add(term); - addContextIriPrefix(prefixes, term, expandedDefinition); - continue; - } - if (definition == null || typeof definition !== "object") continue; - if ((definition as Record)["@type"] === "@id") { - aliases.add(term); - } - const id = (definition as Record)["@id"]; - if (typeof id === "string") { - const expandedId = expandContextIri(id, prefixes); - if (PORTABLE_IRI_KEYS.has(expandedId)) aliases.add(term); - if ((definition as Record)["@prefix"] === true) { - addContextIriPrefix(prefixes, term, expandedId); - } - } - } -}\n\n`; - yield `async function addRemotePortableIriContextAliases( - aliases: Set, - context: unknown, - prefixes: Map, - contextLoader: DocumentLoader, - loadedContexts: Map, - depth = 0, -): Promise { - if (depth > 32 || context == null) return; - if (typeof context === "string") { - if (context === ACTIVITYSTREAMS_CONTEXT) return; - let remoteContext: unknown; - if (loadedContexts.has(context)) { - remoteContext = loadedContexts.get(context); - } else { - const remoteDocument = await contextLoader(context); - const document = remoteDocument?.document; - remoteContext = document != null && typeof document === "object" && - "@context" in document - ? (document as Record)["@context"] - : document; - loadedContexts.set(context, remoteContext); - } - addPortableIriContextAliases(aliases, remoteContext, prefixes, depth + 1); - await addRemotePortableIriContextAliases( - aliases, - remoteContext, - prefixes, - contextLoader, - loadedContexts, - depth + 1, - ); - return; - } - if (Array.isArray(context)) { - for (const entry of context) { - await addRemotePortableIriContextAliases( - aliases, - entry, - prefixes, - contextLoader, - loadedContexts, - depth + 1, - ); - } - } -}\n\n`; - yield `function getPortableIriKeys( - object: Record, - portableIriKeys: ReadonlySet, -): ReadonlySet { - if (!("@context" in object)) return portableIriKeys; - const aliases = new Set(); - const prefixes = new Map(); - addPortableIriContextAliases(aliases, object["@context"], prefixes); - if (aliases.size < 1) return portableIriKeys; - return new Set([...portableIriKeys, ...aliases]); -}\n\n`; - yield `async function getPortableIriKeysWithLoader( - object: Record, - portableIriKeys: ReadonlySet, - contextLoader: DocumentLoader, - loadedContexts = new Map(), -): Promise> { - if (!("@context" in object)) return portableIriKeys; - const aliases = new Set(); - const prefixes = new Map(); - addPortableIriContextAliases(aliases, object["@context"], prefixes); - await addRemotePortableIriContextAliases( - aliases, - object["@context"], - prefixes, - contextLoader, - loadedContexts, - ); - if (aliases.size < 1) return portableIriKeys; - return new Set([...portableIriKeys, ...aliases]); }\n\n`; yield `function hasPortableIri( value: unknown, @@ -420,14 +282,13 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n } if (value == null || typeof value !== "object") return false; const object = value as Record; - const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); return globalThis.Object.keys(object).some((entryKey) => hasPortableIri( object[entryKey], entryKey, depth + 1, key, - nextPortableIriKeys, + portableIriKeys, ) ); }\n\n`; @@ -460,119 +321,13 @@ const ACTIVITYSTREAMS_IRI_PREFIX = "https://www.w3.org/ns/activitystreams#";\n\n } if (value == null || typeof value !== "object") return value; const object = value as Record; - const nextPortableIriKeys = getPortableIriKeys(object, portableIriKeys); for (const entryKey of globalThis.Object.keys(object)) { object[entryKey] = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, - nextPortableIriKeys, - ); - } - return object; -}\n\n`; - yield `async function hasPortableIriWithLoader( - value: unknown, - contextLoader: DocumentLoader, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Map(), -): Promise { - if (depth > 32 || key === "@context") return false; - if (typeof value === "string") { - return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value); - } - if (Array.isArray(value)) { - for (const item of value) { - if ( - await hasPortableIriWithLoader( - item, - contextLoader, - key, - depth + 1, - parentKey, - portableIriKeys, - loadedContexts, - ) - ) return true; - } - return false; - } - if (value == null || typeof value !== "object") return false; - const object = value as Record; - const nextPortableIriKeys = await getPortableIriKeysWithLoader( - object, - portableIriKeys, - contextLoader, - loadedContexts, - ); - for (const entryKey of globalThis.Object.keys(object)) { - if ( - await hasPortableIriWithLoader( - object[entryKey], - contextLoader, - entryKey, - depth + 1, - key, - nextPortableIriKeys, - loadedContexts, - ) - ) return true; - } - return false; -}\n\n`; - yield `async function normalizePortableIrisWithLoader( - value: unknown, - contextLoader: DocumentLoader, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, - loadedContexts = new Map(), -): Promise { - if (depth > 32 || key === "@context") return value; - if (typeof value === "string") { - return key != null && - isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ? formatIri(value) - : value; - } - if (Array.isArray(value)) { - for (let i = 0; i < value.length; i++) { - value[i] = await normalizePortableIrisWithLoader( - value[i], - contextLoader, - key, - depth + 1, - parentKey, - portableIriKeys, - loadedContexts, - ); - } - return value; - } - if (value == null || typeof value !== "object") return value; - const object = value as Record; - const nextPortableIriKeys = await getPortableIriKeysWithLoader( - object, - portableIriKeys, - contextLoader, - loadedContexts, - ); - for (const entryKey of globalThis.Object.keys(object)) { - object[entryKey] = await normalizePortableIrisWithLoader( - object[entryKey], - contextLoader, - entryKey, - depth + 1, - key, - nextPortableIriKeys, - loadedContexts, + portableIriKeys, ); } return object; diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 860254b1d..5b04e85ee 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -410,6 +410,7 @@ export async function* generateDecoder( if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } + const cacheValues = structuredClone(values); `; const subtypes = getSubtypes(typeUri, types, true); yield ` @@ -535,15 +536,19 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const cachedJsonLd = structuredClone(json); - const contextLoader = options.contextLoader ?? getDocumentLoader(); - if (await hasPortableIriWithLoader(cachedJsonLd, contextLoader)) { - instance._cachedJsonLd = await normalizePortableIrisWithLoader( - cachedJsonLd, - contextLoader, - ); - } else if (!hasPortableIri(values)) { - instance._cachedJsonLd = cachedJsonLd; + if (hasPortableIri(cacheValues)) { + const normalizedValues = normalizePortableIris(cacheValues); + const context = json != null && typeof json === "object" && + "@context" in json + ? (json as Record)["@context"] + : undefined; + instance._cachedJsonLd = context == null + ? normalizedValues + : await jsonld.compact(normalizedValues, context, { + documentLoader: options.contextLoader, + }); + } else { + instance._cachedJsonLd = structuredClone(json); } } catch { getLogger(["fedify", "vocab"]).warn( diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 7846f3d1c..b64fce128 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -654,9 +654,7 @@ test("fromJsonLd() formats portable IRIs in JSON-LD containers", async () => { deepStrictEqual(jsonLd.attributedTo, { "@list": ["ap+ef61://did:key:z6Mkabc/actor"], }); - deepStrictEqual(jsonLd.to, { - "@set": ["ap+ef61://did:key:z6Mkabc/followers"], - }); + deepStrictEqual(jsonLd.to, "ap+ef61://did:key:z6Mkabc/followers"); }); test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async () => { @@ -702,8 +700,8 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( const jsonLd = await activity.toJsonLd({ contextLoader: mockDocumentLoader, }) as Record; - deepStrictEqual(jsonLd.actorRef, "ap+ef61://did:key:z6Mkabc/actor"); - deepStrictEqual(jsonLd.targetRef, "ap+ef61://did:key:z6Mkabc/target"); + deepStrictEqual(jsonLd.actor, "ap+ef61://did:key:z6Mkabc/actor"); + deepStrictEqual(jsonLd.target, "ap+ef61://did:key:z6Mkabc/target"); deepStrictEqual(jsonLd.extra, "This extension property should stay cached."); deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); }); @@ -800,7 +798,7 @@ test("fromJsonLd() preserves portable IRIs hidden behind remote contexts", async deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); }); -test("fromJsonLd() preserves portable IRIs hidden behind nested remote contexts", async () => { +test("fromJsonLd() formats portable IRIs hidden behind nested remote contexts", async () => { const rootContextUrl = "https://example.com/contexts/nested-portable-iris"; const nestedContextUrl = "https://example.com/contexts/nested-portable-ref"; const contextLoader: DocumentLoader = async ( @@ -854,14 +852,13 @@ test("fromJsonLd() preserves portable IRIs hidden behind nested remote contexts" unknown >; deepStrictEqual(jsonLd.extraContainer, { - "@context": nestedContextUrl, content: "This text mentions ap://did:key:z6Mkabc/text.", extra: "This nested extension object should stay cached.", - extraRef: "ap+ef61://did:key:z6Mkabc/extra", + extraRef: { id: "ap+ef61://did:key:z6Mkabc/extra" }, }); }); -test("fromJsonLd() reuses remote context aliases for sibling extension objects", async () => { +test("fromJsonLd() formats portable IRIs in sibling remote-context objects", async () => { const rootContextUrl = "https://example.com/contexts/sibling-containers"; const nestedContextUrl = "https://example.com/contexts/sibling-extra-ref"; const contextLoader: DocumentLoader = async ( @@ -918,12 +915,10 @@ test("fromJsonLd() reuses remote context aliases for sibling extension objects", unknown >; deepStrictEqual(jsonLd.firstExtraContainer, { - "@context": nestedContextUrl, content: "No portable IRI here.", }); deepStrictEqual(jsonLd.secondExtraContainer, { - "@context": nestedContextUrl, - extraRef: "ap+ef61://did:key:z6Mkabc/second", + extraRef: { id: "ap+ef61://did:key:z6Mkabc/second" }, }); }); From 43e239b2fa241a7cb9de685db9211ef9c8ef36eb Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 09:09:16 +0900 Subject: [PATCH 18/55] Avoid duplicate portable IRI scans Portable IRI cache normalization already visits every expanded JSON-LD value. Return whether that pass changed anything so callers can decide whether to compact the normalized values without first scanning the same object graph with a separate predicate. https://github.com/fedify-dev/fedify/pull/850 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 716 +++++++++--------- .../src/__snapshots__/class.test.ts.node.snap | 716 +++++++++--------- .../src/__snapshots__/class.test.ts.snap | 716 +++++++++--------- packages/vocab-tools/src/class.ts | 67 +- packages/vocab-tools/src/codec.ts | 8 +- 5 files changed, 1076 insertions(+), 1147 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index e74456718..64c4a8fff 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -34,7 +34,7 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function isPortableIriPosition( +function isPortableIriValuePosition( key: string, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, @@ -44,75 +44,57 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } -function hasPortableIri( - value: unknown, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): boolean { - if (depth > 32 || key === \\"@context\\") return false; - if (typeof value === \\"string\\") { - return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value); - } - if (Array.isArray(value)) { - return value.some((item) => - hasPortableIri(item, key, depth + 1, parentKey, portableIriKeys) - ); - } - if (value == null || typeof value !== \\"object\\") return false; - const object = value as Record; - return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri( - object[entryKey], - entryKey, - depth + 1, - key, - portableIriKeys, - ) - ); -} - function normalizePortableIris( value: unknown, key?: string, depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): unknown { - if (depth > 32 || key === \\"@context\\") return value; +): { value: unknown; changed: boolean } { + if (depth > 32 || key === \\"@context\\") return { value, changed: false }; if (typeof value === \\"string\\") { - return key != null && - isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ? formatIri(value) - : value; + if ( + key != null && + isPortableIriValuePosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value) + ) { + const normalized = formatIri(value); + return { value: normalized, changed: normalized !== value }; + } + return { value, changed: false }; } if (Array.isArray(value)) { + let changed = false; for (let i = 0; i < value.length; i++) { - value[i] = normalizePortableIris( + const result = normalizePortableIris( value[i], key, depth + 1, parentKey, portableIriKeys, ); + value[i] = result.value; + changed ||= result.changed; } - return value; + return { value, changed }; + } + if (value == null || typeof value !== \\"object\\") { + return { value, changed: false }; } - if (value == null || typeof value !== \\"object\\") return value; const object = value as Record; + let changed = false; for (const entryKey of globalThis.Object.keys(object)) { - object[entryKey] = normalizePortableIris( + const result = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, portableIriKeys, ); + object[entryKey] = result.value; + changed ||= result.changed; } - return object; + return { value: object, changed }; } import * as _ppM0 from \\"./preprocessors.ts\\"; @@ -12099,15 +12081,15 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -13312,15 +13294,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -14435,15 +14417,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -17837,15 +17819,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -18343,15 +18325,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -18913,15 +18895,15 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -19511,15 +19493,15 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -20570,15 +20552,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -20970,15 +20952,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -21664,15 +21646,15 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -22388,15 +22370,15 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -23458,15 +23440,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -23857,15 +23839,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -24860,15 +24842,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -25259,15 +25241,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -26261,15 +26243,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -26660,15 +26642,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -27146,15 +27128,15 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -27484,15 +27466,15 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -28427,15 +28409,15 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -29386,15 +29368,15 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -30296,15 +30278,15 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -30915,15 +30897,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -31510,15 +31492,15 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -32397,15 +32379,15 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -33255,15 +33237,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -33691,15 +33673,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -34044,15 +34026,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -34396,15 +34378,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -40730,15 +40712,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -41566,15 +41548,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -41918,15 +41900,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -43036,15 +43018,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -43654,15 +43636,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44048,15 +44030,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44403,15 +44385,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44756,15 +44738,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -49104,15 +49086,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -50687,15 +50669,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51096,15 +51078,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51447,15 +51429,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51796,15 +51778,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -52717,15 +52699,15 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53206,15 +53188,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53558,15 +53540,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53911,15 +53893,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -60245,15 +60227,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -62228,15 +62210,15 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -62735,15 +62717,15 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63089,15 +63071,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63445,15 +63427,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63796,15 +63778,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64147,15 +64129,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64498,15 +64480,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64849,15 +64831,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65198,15 +65180,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65513,15 +65495,15 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65865,15 +65847,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -66985,15 +66967,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -67757,15 +67739,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -68586,15 +68568,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -74962,15 +74944,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -75788,15 +75770,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -82122,15 +82104,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -83518,15 +83500,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -84318,15 +84300,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -86196,15 +86178,15 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -86690,15 +86672,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -87045,15 +87027,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -88699,15 +88681,15 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -89122,15 +89104,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -95456,15 +95438,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -96535,15 +96517,15 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -96947,15 +96929,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -97298,15 +97280,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -97918,15 +97900,15 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -98317,15 +98299,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -98673,15 +98655,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99027,15 +99009,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99381,15 +99363,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99731,15 +99713,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 952de4d11..d1a420603 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -32,7 +32,7 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function isPortableIriPosition( +function isPortableIriValuePosition( key: string, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, @@ -42,75 +42,57 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } -function hasPortableIri( - value: unknown, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): boolean { - if (depth > 32 || key === \\"@context\\") return false; - if (typeof value === \\"string\\") { - return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value); - } - if (Array.isArray(value)) { - return value.some((item) => - hasPortableIri(item, key, depth + 1, parentKey, portableIriKeys) - ); - } - if (value == null || typeof value !== \\"object\\") return false; - const object = value as Record; - return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri( - object[entryKey], - entryKey, - depth + 1, - key, - portableIriKeys, - ) - ); -} - function normalizePortableIris( value: unknown, key?: string, depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): unknown { - if (depth > 32 || key === \\"@context\\") return value; +): { value: unknown; changed: boolean } { + if (depth > 32 || key === \\"@context\\") return { value, changed: false }; if (typeof value === \\"string\\") { - return key != null && - isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ? formatIri(value) - : value; + if ( + key != null && + isPortableIriValuePosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value) + ) { + const normalized = formatIri(value); + return { value: normalized, changed: normalized !== value }; + } + return { value, changed: false }; } if (Array.isArray(value)) { + let changed = false; for (let i = 0; i < value.length; i++) { - value[i] = normalizePortableIris( + const result = normalizePortableIris( value[i], key, depth + 1, parentKey, portableIriKeys, ); + value[i] = result.value; + changed ||= result.changed; } - return value; + return { value, changed }; + } + if (value == null || typeof value !== \\"object\\") { + return { value, changed: false }; } - if (value == null || typeof value !== \\"object\\") return value; const object = value as Record; + let changed = false; for (const entryKey of globalThis.Object.keys(object)) { - object[entryKey] = normalizePortableIris( + const result = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, portableIriKeys, ); + object[entryKey] = result.value; + changed ||= result.changed; } - return object; + return { value: object, changed }; } import * as _ppM0 from \\"./preprocessors.ts\\"; @@ -12097,15 +12079,15 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -13310,15 +13292,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -14433,15 +14415,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -17835,15 +17817,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -18341,15 +18323,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -18911,15 +18893,15 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -19509,15 +19491,15 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -20568,15 +20550,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -20968,15 +20950,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -21662,15 +21644,15 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -22386,15 +22368,15 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -23456,15 +23438,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -23855,15 +23837,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -24858,15 +24840,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -25257,15 +25239,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -26259,15 +26241,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -26658,15 +26640,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -27144,15 +27126,15 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -27482,15 +27464,15 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -28425,15 +28407,15 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -29384,15 +29366,15 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -30294,15 +30276,15 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -30913,15 +30895,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -31508,15 +31490,15 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -32395,15 +32377,15 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -33253,15 +33235,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -33689,15 +33671,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -34042,15 +34024,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -34394,15 +34376,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -40728,15 +40710,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -41564,15 +41546,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -41916,15 +41898,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -43034,15 +43016,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -43652,15 +43634,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44046,15 +44028,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44401,15 +44383,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44754,15 +44736,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -49102,15 +49084,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -50685,15 +50667,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51094,15 +51076,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51445,15 +51427,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51794,15 +51776,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -52715,15 +52697,15 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53204,15 +53186,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53556,15 +53538,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53909,15 +53891,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -60243,15 +60225,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -62226,15 +62208,15 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -62733,15 +62715,15 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63087,15 +63069,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63443,15 +63425,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63794,15 +63776,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64145,15 +64127,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64496,15 +64478,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64847,15 +64829,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65196,15 +65178,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65511,15 +65493,15 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65863,15 +65845,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -66983,15 +66965,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -67755,15 +67737,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -68584,15 +68566,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -74960,15 +74942,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -75786,15 +75768,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -82120,15 +82102,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -83516,15 +83498,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -84316,15 +84298,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -86194,15 +86176,15 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -86688,15 +86670,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -87043,15 +87025,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -88697,15 +88679,15 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -89120,15 +89102,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -95454,15 +95436,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -96533,15 +96515,15 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -96945,15 +96927,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -97296,15 +97278,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -97916,15 +97898,15 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -98315,15 +98297,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -98671,15 +98653,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99025,15 +99007,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99379,15 +99361,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99729,15 +99711,15 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index cf4fd188e..4e837f5a0 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -34,7 +34,7 @@ import { const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","_misskey_quote","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","quoteUri","quoteUrl","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); -function isPortableIriPosition( +function isPortableIriValuePosition( key: string, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, @@ -44,75 +44,57 @@ function isPortableIriPosition( parentKey != null && portableIriKeys.has(parentKey)); } -function hasPortableIri( - value: unknown, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): boolean { - if (depth > 32 || key === "@context") return false; - if (typeof value === "string") { - return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value); - } - if (Array.isArray(value)) { - return value.some((item) => - hasPortableIri(item, key, depth + 1, parentKey, portableIriKeys) - ); - } - if (value == null || typeof value !== "object") return false; - const object = value as Record; - return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri( - object[entryKey], - entryKey, - depth + 1, - key, - portableIriKeys, - ) - ); -} - function normalizePortableIris( value: unknown, key?: string, depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): unknown { - if (depth > 32 || key === "@context") return value; +): { value: unknown; changed: boolean } { + if (depth > 32 || key === "@context") return { value, changed: false }; if (typeof value === "string") { - return key != null && - isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ? formatIri(value) - : value; + if ( + key != null && + isPortableIriValuePosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value) + ) { + const normalized = formatIri(value); + return { value: normalized, changed: normalized !== value }; + } + return { value, changed: false }; } if (Array.isArray(value)) { + let changed = false; for (let i = 0; i < value.length; i++) { - value[i] = normalizePortableIris( + const result = normalizePortableIris( value[i], key, depth + 1, parentKey, portableIriKeys, ); + value[i] = result.value; + changed ||= result.changed; } - return value; + return { value, changed }; + } + if (value == null || typeof value !== "object") { + return { value, changed: false }; } - if (value == null || typeof value !== "object") return value; const object = value as Record; + let changed = false; for (const entryKey of globalThis.Object.keys(object)) { - object[entryKey] = normalizePortableIris( + const result = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, portableIriKeys, ); + object[entryKey] = result.value; + changed ||= result.changed; } - return object; + return { value: object, changed }; } import * as _ppM0 from "./preprocessors.ts"; @@ -12099,15 +12081,15 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -13312,15 +13294,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -14435,15 +14417,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -17837,15 +17819,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -18343,15 +18325,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -18913,15 +18895,15 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -19511,15 +19493,15 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -20570,15 +20552,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -20970,15 +20952,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -21664,15 +21646,15 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -22388,15 +22370,15 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -23458,15 +23440,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -23857,15 +23839,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -24860,15 +24842,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -25259,15 +25241,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -26261,15 +26243,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -26660,15 +26642,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -27146,15 +27128,15 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -27484,15 +27466,15 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -28427,15 +28409,15 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -29386,15 +29368,15 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -30296,15 +30278,15 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -30915,15 +30897,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -31510,15 +31492,15 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -32397,15 +32379,15 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -33255,15 +33237,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -33691,15 +33673,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -34044,15 +34026,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -34396,15 +34378,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -40730,15 +40712,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -41566,15 +41548,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -41918,15 +41900,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -43036,15 +43018,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -43654,15 +43636,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44048,15 +44030,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44403,15 +44385,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -44756,15 +44738,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -49104,15 +49086,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -50687,15 +50669,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51096,15 +51078,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51447,15 +51429,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -51796,15 +51778,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -52717,15 +52699,15 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53206,15 +53188,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53558,15 +53540,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -53911,15 +53893,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -60245,15 +60227,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -62228,15 +62210,15 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -62735,15 +62717,15 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63089,15 +63071,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63445,15 +63427,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -63796,15 +63778,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64147,15 +64129,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64498,15 +64480,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -64849,15 +64831,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65198,15 +65180,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65513,15 +65495,15 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -65865,15 +65847,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -66985,15 +66967,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -67757,15 +67739,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -68586,15 +68568,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -74962,15 +74944,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -75788,15 +75770,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -82122,15 +82104,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -83518,15 +83500,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -84318,15 +84300,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -86196,15 +86178,15 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -86690,15 +86672,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -87045,15 +87027,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -88699,15 +88681,15 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -89122,15 +89104,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -95456,15 +95438,15 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -96535,15 +96517,15 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -96947,15 +96929,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -97298,15 +97280,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -97918,15 +97900,15 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -98317,15 +98299,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -98673,15 +98655,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99027,15 +99009,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99381,15 +99363,15 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { @@ -99731,15 +99713,15 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 03ba5646e..d33de0636 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -254,7 +254,7 @@ export async function* generateClasses( yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ JSON.stringify([...portableIriKeys].sort()) });\n\n`; - yield `function isPortableIriPosition( + yield `function isPortableIriValuePosition( key: string, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, @@ -262,35 +262,6 @@ export async function* generateClasses( return portableIriKeys.has(key) || ((key === "@value" || key === "@list" || key === "@set") && parentKey != null && portableIriKeys.has(parentKey)); -}\n\n`; - yield `function hasPortableIri( - value: unknown, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): boolean { - if (depth > 32 || key === "@context") return false; - if (typeof value === "string") { - return key != null && isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value); - } - if (Array.isArray(value)) { - return value.some((item) => - hasPortableIri(item, key, depth + 1, parentKey, portableIriKeys) - ); - } - if (value == null || typeof value !== "object") return false; - const object = value as Record; - return globalThis.Object.keys(object).some((entryKey) => - hasPortableIri( - object[entryKey], - entryKey, - depth + 1, - key, - portableIriKeys, - ) - ); }\n\n`; yield `function normalizePortableIris( value: unknown, @@ -298,39 +269,51 @@ export async function* generateClasses( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): unknown { - if (depth > 32 || key === "@context") return value; +): { value: unknown; changed: boolean } { + if (depth > 32 || key === "@context") return { value, changed: false }; if (typeof value === "string") { - return key != null && - isPortableIriPosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ? formatIri(value) - : value; + if ( + key != null && + isPortableIriValuePosition(key, parentKey, portableIriKeys) && + PORTABLE_IRI_PATTERN.test(value) + ) { + const normalized = formatIri(value); + return { value: normalized, changed: normalized !== value }; + } + return { value, changed: false }; } if (Array.isArray(value)) { + let changed = false; for (let i = 0; i < value.length; i++) { - value[i] = normalizePortableIris( + const result = normalizePortableIris( value[i], key, depth + 1, parentKey, portableIriKeys, ); + value[i] = result.value; + changed ||= result.changed; } - return value; + return { value, changed }; + } + if (value == null || typeof value !== "object") { + return { value, changed: false }; } - if (value == null || typeof value !== "object") return value; const object = value as Record; + let changed = false; for (const entryKey of globalThis.Object.keys(object)) { - object[entryKey] = normalizePortableIris( + const result = normalizePortableIris( object[entryKey], entryKey, depth + 1, key, portableIriKeys, ); + object[entryKey] = result.value; + changed ||= result.changed; } - return object; + return { value: object, changed }; }\n\n`; const moduleVarNames = new Map(); const sorted = sortTopologically(types); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 5b04e85ee..2bcbb02f3 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -536,15 +536,15 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (hasPortableIri(cacheValues)) { - const normalizedValues = normalizePortableIris(cacheValues); + const normalizedValues = normalizePortableIris(cacheValues); + if (normalizedValues.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; instance._cachedJsonLd = context == null - ? normalizedValues - : await jsonld.compact(normalizedValues, context, { + ? normalizedValues.value + : await jsonld.compact(normalizedValues.value, context, { documentLoader: options.contextLoader, }); } else { From e86a7adac4e58457ac4768e1b5beadbe9c5bb191 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 09:40:46 +0900 Subject: [PATCH 19/55] Reject malformed portable DID authorities Portable ActivityPub IRIs require a DID authority with a method and method-specific identifier. The previous scheme-only check accepted partial authorities that could not be real DIDs. https://github.com/fedify-dev/fedify/pull/850#discussion_r3495359597 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 14 +++++++++++++- packages/vocab-runtime/src/url.ts | 4 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index d7005358a..269aec3df 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -1,4 +1,4 @@ -import { deepStrictEqual, ok, rejects } from "node:assert"; +import { deepStrictEqual, ok, rejects, throws } from "node:assert"; import { test } from "node:test"; import { canParseIri, @@ -62,6 +62,18 @@ test("parseIri() rejects portable IRIs without paths", () => { ok(!canParseIri("ap://did:key:z6Mkabc#actor")); }); +test("parseIri() rejects malformed portable DID authorities", () => { + const cases = [ + "ap://did:/actor", + "ap://did:key/actor", + "ap://did:123:abc/actor", + ]; + for (const iri of cases) { + ok(!canParseIri(iri)); + throws(() => parseIri(iri), TypeError); + } +}); + test("parseIri() normalizes portable URL instances", () => { deepStrictEqual( parseIri(new URL("ap+ef61://did%3Aexample%3Aabc%2Fdef/actor")), diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index f177eba58..39e79ebc9 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -13,6 +13,8 @@ const PORTABLE_IRI_PATTERN = /^(ap|ap\+ef61):\/\/([^/?#]*)([^?#]*)(\?[^#]*)?(#.*)?$/i; const INVALID_PERCENT_ENCODING_PATTERN = /%(?![0-9A-Fa-f]{2})/; const DID_SCHEME_PATTERN = /^did:/i; +const DID_PATTERN = + /^did:[a-z][a-z0-9]*:[A-Za-z0-9._:%-]+(?::[A-Za-z0-9._:%-]+)*$/i; /** * Checks whether the given string can be parsed as an IRI. @@ -61,7 +63,7 @@ function parsePortableIri(iri: string): URL | null { const match = iri.match(PORTABLE_IRI_PATTERN); if (match == null) return null; const authority = decodePortableAuthority(match[2]); - if (!DID_SCHEME_PATTERN.test(authority)) { + if (!DID_PATTERN.test(authority)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } if (match[3] === "") { From def6d450a7da7c85df71552bfac6d473d4cb137a Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 09:40:54 +0900 Subject: [PATCH 20/55] Preserve portable IRI cache shape Normalize portable IRIs with lazy cloning so unchanged JSON-LD subtrees are not copied or mutated. Cache normalization now runs on the expanded input shape before parser-side mutations, which preserves contextless expanded arrays and their sibling graph nodes. https://github.com/fedify-dev/fedify/pull/850#discussion_r3495351078 https://github.com/fedify-dev/fedify/pull/850#discussion_r3495351082 https://github.com/fedify-dev/fedify/pull/850#discussion_r3495400917 https://github.com/fedify-dev/fedify/pull/850#discussion_r3495416895 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 2047 ++++++++++++----- .../src/__snapshots__/class.test.ts.node.snap | 2047 ++++++++++++----- .../src/__snapshots__/class.test.ts.snap | 2047 ++++++++++++----- packages/vocab-tools/src/class.ts | 22 +- packages/vocab-tools/src/codec.ts | 26 +- packages/vocab/src/vocab.test.ts | 54 + 6 files changed, 4503 insertions(+), 1740 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 64c4a8fff..5ce42f9eb 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -64,7 +64,7 @@ function normalizePortableIris( return { value, changed: false }; } if (Array.isArray(value)) { - let changed = false; + let clone: unknown[] | undefined; for (let i = 0; i < value.length; i++) { const result = normalizePortableIris( value[i], @@ -73,16 +73,20 @@ function normalizePortableIris( parentKey, portableIriKeys, ); - value[i] = result.value; - changed ||= result.changed; + if (result.changed) { + clone ??= value.slice(0, i); + clone.push(result.value); + } else if (clone != null) { + clone.push(value[i]); + } } - return { value, changed }; + return { value: clone ?? value, changed: clone != null }; } if (value == null || typeof value !== \\"object\\") { return { value, changed: false }; } const object = value as Record; - let changed = false; + let clone: Record | undefined; for (const entryKey of globalThis.Object.keys(object)) { const result = normalizePortableIris( object[entryKey], @@ -91,10 +95,12 @@ function normalizePortableIris( key, portableIriKeys, ); - object[entryKey] = result.value; - changed ||= result.changed; + if (result.changed) { + clone ??= { ...object }; + clone[entryKey] = result.value; + } } - return { value: object, changed }; + return { value: clone ?? object, changed: clone != null }; } import * as _ppM0 from \\"./preprocessors.ts\\"; @@ -10658,10 +10664,12 @@ get urls(): ((URL | Link))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -10675,7 +10683,6 @@ get urls(): ((URL | Link))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -10944,6 +10951,10 @@ get urls(): ((URL | Link))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -12081,17 +12092,23 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -13252,10 +13269,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -13269,7 +13288,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -13282,6 +13300,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -13294,17 +13316,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -14289,10 +14317,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -14306,7 +14336,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -14319,6 +14348,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -14417,17 +14450,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -17441,10 +17480,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -17458,7 +17499,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -17607,6 +17647,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -17819,17 +17863,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -18283,10 +18333,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -18300,7 +18352,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18313,6 +18364,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -18325,17 +18380,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -18810,10 +18871,12 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -18827,7 +18890,6 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18840,6 +18902,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -18895,17 +18961,23 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -19420,10 +19492,12 @@ unit?: string | null;numericalValue?: Decimal | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -19437,7 +19511,6 @@ unit?: string | null;numericalValue?: Decimal | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19450,6 +19523,10 @@ unit?: string | null;numericalValue?: Decimal | null;} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -19493,17 +19570,23 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -20450,10 +20533,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -20467,7 +20552,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20480,6 +20564,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -20552,17 +20640,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -20910,10 +21004,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -20927,7 +21023,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20940,6 +21035,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -20952,17 +21051,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -21525,10 +21630,12 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -21542,7 +21649,6 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -21555,6 +21661,10 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -21646,17 +21756,23 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -22297,10 +22413,12 @@ get manualApprovals(): (URL)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -22314,7 +22432,6 @@ get manualApprovals(): (URL)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -22327,6 +22444,10 @@ get manualApprovals(): (URL)[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -22370,17 +22491,23 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -23338,10 +23465,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -23355,7 +23484,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23368,6 +23496,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -23440,17 +23572,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -23797,10 +23935,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -23814,7 +23954,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23827,6 +23966,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -23839,17 +23982,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -24740,10 +24889,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -24757,7 +24908,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -24770,6 +24920,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -24842,17 +24996,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -25199,10 +25359,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -25216,7 +25378,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -25229,6 +25390,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -25241,17 +25406,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -26141,10 +26312,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -26158,7 +26331,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26171,6 +26343,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -26243,17 +26419,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -26600,10 +26782,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -26617,7 +26801,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26630,6 +26813,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -26642,17 +26829,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -27069,10 +27262,12 @@ get endpoints(): (URL)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -27086,7 +27281,6 @@ get endpoints(): (URL)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27103,6 +27297,10 @@ get endpoints(): (URL)[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -27128,17 +27326,23 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -27424,10 +27628,12 @@ endpoints?: (URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -27441,7 +27647,6 @@ endpoints?: (URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27454,6 +27659,10 @@ endpoints?: (URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -27466,17 +27675,23 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -28266,10 +28481,12 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -28283,7 +28500,6 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -28296,6 +28512,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -28409,17 +28629,23 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -29263,10 +29489,12 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -29280,7 +29508,6 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -29293,6 +29520,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -29368,17 +29599,23 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -30173,10 +30410,12 @@ controller?: Application | Group | Organization | Person | Service | URL | null; }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -30190,7 +30429,6 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30203,6 +30441,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -30278,17 +30520,23 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -30813,10 +31061,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -30830,7 +31080,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30843,6 +31092,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -30897,17 +31150,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -31416,10 +31675,12 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -31433,7 +31694,6 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -31446,6 +31706,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -31492,17 +31756,23 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -32243,10 +32513,12 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -32260,7 +32532,6 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -32273,6 +32544,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -32379,17 +32654,23 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33117,10 +33398,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -33134,7 +33417,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33147,6 +33429,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -33237,17 +33523,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33627,10 +33919,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -33644,7 +33938,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33661,6 +33954,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -33673,17 +33970,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33984,10 +34287,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -34001,7 +34306,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -34014,6 +34318,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -34026,17 +34334,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -34336,10 +34650,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -34353,7 +34669,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -34366,6 +34681,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -34378,17 +34697,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -40053,10 +40378,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -40070,7 +40397,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -40083,6 +40409,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -40712,17 +41042,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -41494,10 +41830,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -41511,7 +41849,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41536,6 +41873,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -41548,17 +41889,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -41858,10 +42205,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -41875,7 +42224,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41888,6 +42236,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -41900,17 +42252,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -42890,10 +43248,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -42907,7 +43267,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -42920,6 +43279,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -43018,17 +43381,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -43542,10 +43911,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -43559,7 +43930,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -43588,6 +43958,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -43636,17 +44010,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -43988,10 +44368,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44005,7 +44387,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44018,6 +44399,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44030,17 +44415,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -44339,10 +44730,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44356,7 +44749,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44373,6 +44765,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44385,17 +44781,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -44696,10 +45098,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44713,7 +45117,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44726,6 +45129,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44738,17 +45145,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -48644,10 +49057,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -48661,7 +49076,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -48686,6 +49100,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -49086,17 +49504,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -50533,10 +50957,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -50550,7 +50976,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -50567,6 +50992,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -50669,17 +51098,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51036,10 +51471,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51053,7 +51490,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51066,6 +51502,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51078,17 +51518,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51387,10 +51833,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51404,7 +51852,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51417,6 +51864,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51429,17 +51880,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51736,10 +52193,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51753,7 +52212,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51766,6 +52224,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51778,17 +52240,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -52554,10 +53022,12 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -52571,7 +53041,6 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -52584,6 +53053,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -52699,17 +53172,23 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53146,10 +53625,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53163,7 +53644,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53176,6 +53656,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53188,17 +53672,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53498,10 +53988,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53515,7 +54007,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53528,6 +54019,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53540,17 +54035,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53851,10 +54352,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53868,7 +54371,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53881,6 +54383,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53893,17 +54399,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -59568,10 +60080,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -59585,7 +60099,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -59598,6 +60111,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -60227,17 +60744,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -61993,10 +62516,12 @@ get names(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -62010,7 +62535,6 @@ get names(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62031,6 +62555,10 @@ get names(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -62210,17 +62738,23 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -62675,10 +63209,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -62692,7 +63228,6 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62705,6 +63240,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -62717,17 +63256,23 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63029,10 +63574,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63046,7 +63593,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63059,6 +63605,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63071,17 +63621,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63381,10 +63937,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63398,7 +63956,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63415,6 +63972,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63427,17 +63988,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63736,10 +64303,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63753,7 +64322,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63766,6 +64334,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63778,17 +64350,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64087,10 +64665,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64104,7 +64684,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64117,6 +64696,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64129,17 +64712,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64438,10 +65027,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64455,7 +65046,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64468,6 +65058,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64480,17 +65074,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64789,10 +65389,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64806,7 +65408,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64819,6 +65420,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64831,17 +65436,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65138,10 +65749,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65155,7 +65768,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65168,6 +65780,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65180,17 +65796,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65453,10 +66075,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65470,7 +66094,6 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65483,6 +66106,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65495,17 +66122,23 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65805,10 +66438,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65822,7 +66457,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65835,6 +66469,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65847,17 +66485,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -66839,10 +67483,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -66856,7 +67502,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -66869,6 +67514,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -66967,17 +67616,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -67657,10 +68312,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -67674,7 +68331,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -67687,6 +68343,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -67739,17 +68399,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -68468,10 +69134,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -68485,7 +69153,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -68498,6 +69165,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -68568,17 +69239,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -74285,10 +74962,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -74302,7 +74981,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -74315,6 +74993,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -74944,17 +75626,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -75728,10 +76416,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -75745,7 +76435,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -75758,6 +76447,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -75770,17 +76463,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -81445,10 +82144,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -81462,7 +82163,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -81475,6 +82175,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -82104,17 +82808,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -83344,10 +84054,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -83361,7 +84073,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -83374,6 +84085,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -83500,17 +84215,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -84228,10 +84949,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -84245,7 +84968,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -84258,6 +84980,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -84300,17 +85026,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -85941,10 +86673,12 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -85958,7 +86692,6 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -85971,6 +86704,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -86178,17 +86915,23 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -86630,10 +87373,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -86647,7 +87392,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86660,6 +87404,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -86672,17 +87420,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -86981,10 +87735,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -86998,7 +87754,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -87015,6 +87770,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -87027,17 +87786,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -88549,10 +89314,12 @@ relationships?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -88566,7 +89333,6 @@ relationships?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -88579,6 +89345,10 @@ relationships?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -88681,17 +89451,23 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -89062,10 +89838,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -89079,7 +89857,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -89092,6 +89869,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -89104,17 +89885,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -94779,10 +95566,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -94796,7 +95585,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -94809,6 +95597,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -95438,17 +96230,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -96438,10 +97236,12 @@ get contents(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -96455,7 +97255,6 @@ get contents(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -96468,6 +97267,10 @@ get contents(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -96517,17 +97320,23 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -96887,10 +97696,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -96904,7 +97715,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -96917,6 +97727,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -96929,17 +97743,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -97238,10 +98058,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -97255,7 +98077,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -97268,6 +98089,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -97280,17 +98105,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -97805,10 +98636,12 @@ get formerTypes(): (\$EntityType)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -97822,7 +98655,6 @@ get formerTypes(): (\$EntityType)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -97835,6 +98667,10 @@ get formerTypes(): (\$EntityType)[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -97900,17 +98736,23 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98257,10 +99099,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98274,7 +99118,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98287,6 +99130,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -98299,17 +99146,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98613,10 +99466,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98630,7 +99485,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98643,6 +99497,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -98655,17 +99513,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98967,10 +99831,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98984,7 +99850,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98997,6 +99862,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99009,17 +99878,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -99321,10 +100196,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -99338,7 +100215,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -99351,6 +100227,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99363,17 +100243,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -99671,10 +100557,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -99688,7 +100576,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -99701,6 +100588,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99713,17 +100604,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index d1a420603..a35756e3b 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -62,7 +62,7 @@ function normalizePortableIris( return { value, changed: false }; } if (Array.isArray(value)) { - let changed = false; + let clone: unknown[] | undefined; for (let i = 0; i < value.length; i++) { const result = normalizePortableIris( value[i], @@ -71,16 +71,20 @@ function normalizePortableIris( parentKey, portableIriKeys, ); - value[i] = result.value; - changed ||= result.changed; + if (result.changed) { + clone ??= value.slice(0, i); + clone.push(result.value); + } else if (clone != null) { + clone.push(value[i]); + } } - return { value, changed }; + return { value: clone ?? value, changed: clone != null }; } if (value == null || typeof value !== \\"object\\") { return { value, changed: false }; } const object = value as Record; - let changed = false; + let clone: Record | undefined; for (const entryKey of globalThis.Object.keys(object)) { const result = normalizePortableIris( object[entryKey], @@ -89,10 +93,12 @@ function normalizePortableIris( key, portableIriKeys, ); - object[entryKey] = result.value; - changed ||= result.changed; + if (result.changed) { + clone ??= { ...object }; + clone[entryKey] = result.value; + } } - return { value: object, changed }; + return { value: clone ?? object, changed: clone != null }; } import * as _ppM0 from \\"./preprocessors.ts\\"; @@ -10656,10 +10662,12 @@ get urls(): ((URL | Link))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -10673,7 +10681,6 @@ get urls(): ((URL | Link))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -10942,6 +10949,10 @@ get urls(): ((URL | Link))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -12079,17 +12090,23 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -13250,10 +13267,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -13267,7 +13286,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -13280,6 +13298,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -13292,17 +13314,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -14287,10 +14315,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -14304,7 +14334,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -14317,6 +14346,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -14415,17 +14448,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -17439,10 +17478,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -17456,7 +17497,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -17605,6 +17645,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -17817,17 +17861,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -18281,10 +18331,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -18298,7 +18350,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18311,6 +18362,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -18323,17 +18378,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -18808,10 +18869,12 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -18825,7 +18888,6 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -18838,6 +18900,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -18893,17 +18959,23 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -19418,10 +19490,12 @@ unit?: string | null;numericalValue?: Decimal | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -19435,7 +19509,6 @@ unit?: string | null;numericalValue?: Decimal | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -19448,6 +19521,10 @@ unit?: string | null;numericalValue?: Decimal | null;} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -19491,17 +19568,23 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -20448,10 +20531,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -20465,7 +20550,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20478,6 +20562,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -20550,17 +20638,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -20908,10 +21002,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -20925,7 +21021,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -20938,6 +21033,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -20950,17 +21049,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -21523,10 +21628,12 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -21540,7 +21647,6 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -21553,6 +21659,10 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -21644,17 +21754,23 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -22295,10 +22411,12 @@ get manualApprovals(): (URL)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -22312,7 +22430,6 @@ get manualApprovals(): (URL)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -22325,6 +22442,10 @@ get manualApprovals(): (URL)[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -22368,17 +22489,23 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -23336,10 +23463,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -23353,7 +23482,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23366,6 +23494,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -23438,17 +23570,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -23795,10 +23933,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -23812,7 +23952,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -23825,6 +23964,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -23837,17 +23980,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -24738,10 +24887,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -24755,7 +24906,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -24768,6 +24918,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -24840,17 +24994,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -25197,10 +25357,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -25214,7 +25376,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -25227,6 +25388,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -25239,17 +25404,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -26139,10 +26310,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -26156,7 +26329,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26169,6 +26341,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -26241,17 +26417,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -26598,10 +26780,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -26615,7 +26799,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -26628,6 +26811,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -26640,17 +26827,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -27067,10 +27260,12 @@ get endpoints(): (URL)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -27084,7 +27279,6 @@ get endpoints(): (URL)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27101,6 +27295,10 @@ get endpoints(): (URL)[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -27126,17 +27324,23 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -27422,10 +27626,12 @@ endpoints?: (URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -27439,7 +27645,6 @@ endpoints?: (URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -27452,6 +27657,10 @@ endpoints?: (URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -27464,17 +27673,23 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -28264,10 +28479,12 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -28281,7 +28498,6 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -28294,6 +28510,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -28407,17 +28627,23 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -29261,10 +29487,12 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -29278,7 +29506,6 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -29291,6 +29518,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -29366,17 +29597,23 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -30171,10 +30408,12 @@ controller?: Application | Group | Organization | Person | Service | URL | null; }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -30188,7 +30427,6 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30201,6 +30439,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -30276,17 +30518,23 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -30811,10 +31059,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -30828,7 +31078,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -30841,6 +31090,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -30895,17 +31148,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -31414,10 +31673,12 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -31431,7 +31692,6 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -31444,6 +31704,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -31490,17 +31754,23 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -32241,10 +32511,12 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -32258,7 +32530,6 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -32271,6 +32542,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -32377,17 +32652,23 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33115,10 +33396,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -33132,7 +33415,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33145,6 +33427,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -33235,17 +33521,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33625,10 +33917,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -33642,7 +33936,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -33659,6 +33952,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -33671,17 +33968,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33982,10 +34285,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -33999,7 +34304,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -34012,6 +34316,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -34024,17 +34332,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -34334,10 +34648,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -34351,7 +34667,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -34364,6 +34679,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -34376,17 +34695,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -40051,10 +40376,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -40068,7 +40395,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -40081,6 +40407,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -40710,17 +41040,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -41492,10 +41828,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -41509,7 +41847,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41534,6 +41871,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -41546,17 +41887,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -41856,10 +42203,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -41873,7 +42222,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -41886,6 +42234,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -41898,17 +42250,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -42888,10 +43246,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -42905,7 +43265,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -42918,6 +43277,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -43016,17 +43379,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -43540,10 +43909,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -43557,7 +43928,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -43586,6 +43956,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -43634,17 +44008,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -43986,10 +44366,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44003,7 +44385,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44016,6 +44397,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44028,17 +44413,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -44337,10 +44728,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44354,7 +44747,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44371,6 +44763,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44383,17 +44779,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -44694,10 +45096,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44711,7 +45115,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -44724,6 +45127,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44736,17 +45143,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -48642,10 +49055,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -48659,7 +49074,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -48684,6 +49098,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -49084,17 +49502,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -50531,10 +50955,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -50548,7 +50974,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -50565,6 +50990,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -50667,17 +51096,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51034,10 +51469,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51051,7 +51488,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51064,6 +51500,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51076,17 +51516,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51385,10 +51831,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51402,7 +51850,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51415,6 +51862,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51427,17 +51878,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51734,10 +52191,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51751,7 +52210,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -51764,6 +52222,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51776,17 +52238,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -52552,10 +53020,12 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -52569,7 +53039,6 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -52582,6 +53051,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -52697,17 +53170,23 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53144,10 +53623,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53161,7 +53642,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53174,6 +53654,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53186,17 +53670,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53496,10 +53986,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53513,7 +54005,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53526,6 +54017,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53538,17 +54033,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53849,10 +54350,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53866,7 +54369,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -53879,6 +54381,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53891,17 +54397,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -59566,10 +60078,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -59583,7 +60097,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -59596,6 +60109,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -60225,17 +60742,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -61991,10 +62514,12 @@ get names(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -62008,7 +62533,6 @@ get names(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62029,6 +62553,10 @@ get names(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -62208,17 +62736,23 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -62673,10 +63207,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -62690,7 +63226,6 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -62703,6 +63238,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -62715,17 +63254,23 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63027,10 +63572,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63044,7 +63591,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63057,6 +63603,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63069,17 +63619,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63379,10 +63935,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63396,7 +63954,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63413,6 +63970,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63425,17 +63986,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63734,10 +64301,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63751,7 +64320,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -63764,6 +64332,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63776,17 +64348,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64085,10 +64663,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64102,7 +64682,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64115,6 +64694,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64127,17 +64710,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64436,10 +65025,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64453,7 +65044,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64466,6 +65056,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64478,17 +65072,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64787,10 +65387,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64804,7 +65406,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -64817,6 +65418,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64829,17 +65434,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65136,10 +65747,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65153,7 +65766,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65166,6 +65778,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65178,17 +65794,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65451,10 +66073,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65468,7 +66092,6 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65481,6 +66104,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65493,17 +66120,23 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65803,10 +66436,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65820,7 +66455,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -65833,6 +66467,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65845,17 +66483,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -66837,10 +67481,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -66854,7 +67500,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -66867,6 +67512,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -66965,17 +67614,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -67655,10 +68310,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -67672,7 +68329,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -67685,6 +68341,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -67737,17 +68397,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -68466,10 +69132,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -68483,7 +69151,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -68496,6 +69163,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -68566,17 +69237,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -74283,10 +74960,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -74300,7 +74979,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -74313,6 +74991,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -74942,17 +75624,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -75726,10 +76414,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -75743,7 +76433,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -75756,6 +76445,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -75768,17 +76461,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -81443,10 +82142,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -81460,7 +82161,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -81473,6 +82173,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -82102,17 +82806,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -83342,10 +84052,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -83359,7 +84071,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -83372,6 +84083,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -83498,17 +84213,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -84226,10 +84947,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -84243,7 +84966,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -84256,6 +84978,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -84298,17 +85024,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -85939,10 +86671,12 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -85956,7 +86690,6 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -85969,6 +86702,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -86176,17 +86913,23 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -86628,10 +87371,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -86645,7 +87390,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -86658,6 +87402,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -86670,17 +87418,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -86979,10 +87733,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -86996,7 +87752,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -87013,6 +87768,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -87025,17 +87784,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -88547,10 +89312,12 @@ relationships?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -88564,7 +89331,6 @@ relationships?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -88577,6 +89343,10 @@ relationships?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -88679,17 +89449,23 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -89060,10 +89836,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -89077,7 +89855,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -89090,6 +89867,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -89102,17 +89883,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -94777,10 +95564,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -94794,7 +95583,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -94807,6 +95595,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -95436,17 +96228,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -96436,10 +97234,12 @@ get contents(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -96453,7 +97253,6 @@ get contents(): ((string | LanguageString))[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -96466,6 +97265,10 @@ get contents(): ((string | LanguageString))[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, options, @@ -96515,17 +97318,23 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -96885,10 +97694,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -96902,7 +97713,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -96915,6 +97725,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -96927,17 +97741,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -97236,10 +98056,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -97253,7 +98075,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -97266,6 +98087,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -97278,17 +98103,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -97803,10 +98634,12 @@ get formerTypes(): ($EntityType)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -97820,7 +98653,6 @@ get formerTypes(): ($EntityType)[] { if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -97833,6 +98665,10 @@ get formerTypes(): ($EntityType)[] { } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -97898,17 +98734,23 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98255,10 +99097,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98272,7 +99116,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98285,6 +99128,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -98297,17 +99144,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98611,10 +99464,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98628,7 +99483,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98641,6 +99495,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -98653,17 +99511,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98965,10 +99829,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98982,7 +99848,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -98995,6 +99860,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99007,17 +99876,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -99319,10 +100194,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -99336,7 +100213,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -99349,6 +100225,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99361,17 +100241,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -99669,10 +100555,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { \\"@id\\"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -99686,7 +100574,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } - const cacheValues = structuredClone(values); if (\\"@type\\" in values) { span.setAttribute(\\"activitypub.object.type\\", values[\\"@type\\"]); @@ -99699,6 +100586,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99711,17 +100602,23 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === \\"object\\" && \\"@context\\" in json ? (json as Record)[\\"@context\\"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 4e837f5a0..3b7f8a9f1 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -64,7 +64,7 @@ function normalizePortableIris( return { value, changed: false }; } if (Array.isArray(value)) { - let changed = false; + let clone: unknown[] | undefined; for (let i = 0; i < value.length; i++) { const result = normalizePortableIris( value[i], @@ -73,16 +73,20 @@ function normalizePortableIris( parentKey, portableIriKeys, ); - value[i] = result.value; - changed ||= result.changed; + if (result.changed) { + clone ??= value.slice(0, i); + clone.push(result.value); + } else if (clone != null) { + clone.push(value[i]); + } } - return { value, changed }; + return { value: clone ?? value, changed: clone != null }; } if (value == null || typeof value !== "object") { return { value, changed: false }; } const object = value as Record; - let changed = false; + let clone: Record | undefined; for (const entryKey of globalThis.Object.keys(object)) { const result = normalizePortableIris( object[entryKey], @@ -91,10 +95,12 @@ function normalizePortableIris( key, portableIriKeys, ); - object[entryKey] = result.value; - changed ||= result.changed; + if (result.changed) { + clone ??= { ...object }; + clone[entryKey] = result.value; + } } - return { value: object, changed }; + return { value: clone ?? object, changed: clone != null }; } import * as _ppM0 from "./preprocessors.ts"; @@ -10658,10 +10664,12 @@ get urls(): ((URL | Link))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -10675,7 +10683,6 @@ get urls(): ((URL | Link))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -10944,6 +10951,10 @@ get urls(): ((URL | Link))[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -12081,17 +12092,23 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -13252,10 +13269,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -13269,7 +13288,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -13282,6 +13300,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -13294,17 +13316,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -14289,10 +14317,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -14306,7 +14336,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -14319,6 +14348,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -14417,17 +14450,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -17441,10 +17480,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -17458,7 +17499,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -17607,6 +17647,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -17819,17 +17863,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -18283,10 +18333,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -18300,7 +18352,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -18313,6 +18364,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -18325,17 +18380,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -18810,10 +18871,12 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -18827,7 +18890,6 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -18840,6 +18902,10 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -18895,17 +18961,23 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -19420,10 +19492,12 @@ unit?: string | null;numericalValue?: Decimal | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -19437,7 +19511,6 @@ unit?: string | null;numericalValue?: Decimal | null;} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -19450,6 +19523,10 @@ unit?: string | null;numericalValue?: Decimal | null;} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -19493,17 +19570,23 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -20450,10 +20533,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -20467,7 +20552,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -20480,6 +20564,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -20552,17 +20640,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -20910,10 +21004,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -20927,7 +21023,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -20940,6 +21035,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -20952,17 +21051,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -21525,10 +21630,12 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -21542,7 +21649,6 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -21555,6 +21661,10 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -21646,17 +21756,23 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -22297,10 +22413,12 @@ get manualApprovals(): (URL)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -22314,7 +22432,6 @@ get manualApprovals(): (URL)[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -22327,6 +22444,10 @@ get manualApprovals(): (URL)[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -22370,17 +22491,23 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -23338,10 +23465,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -23355,7 +23484,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -23368,6 +23496,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -23440,17 +23572,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -23797,10 +23935,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -23814,7 +23954,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -23827,6 +23966,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -23839,17 +23982,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -24740,10 +24889,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -24757,7 +24908,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -24770,6 +24920,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -24842,17 +24996,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -25199,10 +25359,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -25216,7 +25378,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -25229,6 +25390,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -25241,17 +25406,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -26141,10 +26312,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -26158,7 +26331,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -26171,6 +26343,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -26243,17 +26419,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -26600,10 +26782,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -26617,7 +26801,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -26630,6 +26813,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -26642,17 +26829,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -27069,10 +27262,12 @@ get endpoints(): (URL)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -27086,7 +27281,6 @@ get endpoints(): (URL)[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -27103,6 +27297,10 @@ get endpoints(): (URL)[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -27128,17 +27326,23 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -27424,10 +27628,12 @@ endpoints?: (URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -27441,7 +27647,6 @@ endpoints?: (URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -27454,6 +27659,10 @@ endpoints?: (URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -27466,17 +27675,23 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -28266,10 +28481,12 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -28283,7 +28500,6 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -28296,6 +28512,10 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -28409,17 +28629,23 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -29263,10 +29489,12 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -29280,7 +29508,6 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -29293,6 +29520,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -29368,17 +29599,23 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -30173,10 +30410,12 @@ controller?: Application | Group | Organization | Person | Service | URL | null; }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -30190,7 +30429,6 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -30203,6 +30441,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -30278,17 +30520,23 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -30813,10 +31061,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -30830,7 +31080,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -30843,6 +31092,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -30897,17 +31150,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -31416,10 +31675,12 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -31433,7 +31694,6 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -31446,6 +31706,10 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -31492,17 +31756,23 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -32243,10 +32513,12 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -32260,7 +32532,6 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -32273,6 +32544,10 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -32379,17 +32654,23 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33117,10 +33398,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -33134,7 +33417,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -33147,6 +33429,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -33237,17 +33523,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33627,10 +33919,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -33644,7 +33938,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -33661,6 +33954,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -33673,17 +33970,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -33984,10 +34287,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -34001,7 +34306,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -34014,6 +34318,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -34026,17 +34334,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -34336,10 +34650,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -34353,7 +34669,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -34366,6 +34681,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -34378,17 +34697,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -40053,10 +40378,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -40070,7 +40397,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -40083,6 +40409,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -40712,17 +41042,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -41494,10 +41830,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -41511,7 +41849,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -41536,6 +41873,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -41548,17 +41889,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -41858,10 +42205,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -41875,7 +42224,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -41888,6 +42236,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -41900,17 +42252,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -42890,10 +43248,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -42907,7 +43267,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -42920,6 +43279,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -43018,17 +43381,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -43542,10 +43911,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -43559,7 +43930,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -43588,6 +43958,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -43636,17 +44010,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -43988,10 +44368,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44005,7 +44387,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -44018,6 +44399,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44030,17 +44415,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -44339,10 +44730,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44356,7 +44749,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -44373,6 +44765,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44385,17 +44781,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -44696,10 +45098,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -44713,7 +45117,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -44726,6 +45129,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -44738,17 +45145,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -48644,10 +49057,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -48661,7 +49076,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -48686,6 +49100,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -49086,17 +49504,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -50533,10 +50957,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -50550,7 +50976,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -50567,6 +50992,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -50669,17 +51098,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51036,10 +51471,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51053,7 +51490,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -51066,6 +51502,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51078,17 +51518,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51387,10 +51833,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51404,7 +51852,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -51417,6 +51864,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51429,17 +51880,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -51736,10 +52193,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -51753,7 +52212,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -51766,6 +52224,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -51778,17 +52240,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -52554,10 +53022,12 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -52571,7 +53041,6 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -52584,6 +53053,10 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -52699,17 +53172,23 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53146,10 +53625,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53163,7 +53644,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -53176,6 +53656,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53188,17 +53672,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53498,10 +53988,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53515,7 +54007,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -53528,6 +54019,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53540,17 +54035,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -53851,10 +54352,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -53868,7 +54371,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -53881,6 +54383,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -53893,17 +54399,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -59568,10 +60080,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -59585,7 +60099,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -59598,6 +60111,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -60227,17 +60744,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -61993,10 +62516,12 @@ get names(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -62010,7 +62535,6 @@ get names(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -62031,6 +62555,10 @@ get names(): ((string | LanguageString))[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -62210,17 +62738,23 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -62675,10 +63209,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -62692,7 +63228,6 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -62705,6 +63240,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -62717,17 +63256,23 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63029,10 +63574,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63046,7 +63593,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -63059,6 +63605,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63071,17 +63621,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63381,10 +63937,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63398,7 +63956,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -63415,6 +63972,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63427,17 +63988,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -63736,10 +64303,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -63753,7 +64322,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -63766,6 +64334,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -63778,17 +64350,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64087,10 +64665,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64104,7 +64684,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -64117,6 +64696,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64129,17 +64712,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64438,10 +65027,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64455,7 +65046,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -64468,6 +65058,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64480,17 +65074,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -64789,10 +65389,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -64806,7 +65408,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -64819,6 +65420,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -64831,17 +65436,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65138,10 +65749,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65155,7 +65768,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -65168,6 +65780,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65180,17 +65796,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65453,10 +66075,12 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65470,7 +66094,6 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -65483,6 +66106,10 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65495,17 +66122,23 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -65805,10 +66438,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -65822,7 +66457,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -65835,6 +66469,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -65847,17 +66485,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -66839,10 +67483,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -66856,7 +67502,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -66869,6 +67514,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -66967,17 +67616,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -67657,10 +68312,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -67674,7 +68331,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -67687,6 +68343,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -67739,17 +68399,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -68468,10 +69134,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -68485,7 +69153,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -68498,6 +69165,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -68568,17 +69239,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -74285,10 +74962,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -74302,7 +74981,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -74315,6 +74993,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -74944,17 +75626,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -75728,10 +76416,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -75745,7 +76435,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -75758,6 +76447,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -75770,17 +76463,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -81445,10 +82144,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -81462,7 +82163,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -81475,6 +82175,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -82104,17 +82808,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -83344,10 +84054,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -83361,7 +84073,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -83374,6 +84085,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -83500,17 +84215,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -84228,10 +84949,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -84245,7 +84968,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -84258,6 +84980,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -84300,17 +85026,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -85941,10 +86673,12 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -85958,7 +86692,6 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -85971,6 +86704,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -86178,17 +86915,23 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -86630,10 +87373,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -86647,7 +87392,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -86660,6 +87404,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -86672,17 +87420,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -86981,10 +87735,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -86998,7 +87754,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -87015,6 +87770,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -87027,17 +87786,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -88549,10 +89314,12 @@ relationships?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -88566,7 +89333,6 @@ relationships?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -88579,6 +89345,10 @@ relationships?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -88681,17 +89451,23 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -89062,10 +89838,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -89079,7 +89857,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -89092,6 +89869,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -89104,17 +89885,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -94779,10 +95566,12 @@ get preferredUsernames(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -94796,7 +95585,6 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -94809,6 +95597,10 @@ get preferredUsernames(): ((string | LanguageString))[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -95438,17 +96230,23 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -96438,10 +97236,12 @@ get contents(): ((string | LanguageString))[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -96455,7 +97255,6 @@ get contents(): ((string | LanguageString))[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -96468,6 +97267,10 @@ get contents(): ((string | LanguageString))[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, options, @@ -96517,17 +97320,23 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -96887,10 +97696,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -96904,7 +97715,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -96917,6 +97727,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -96929,17 +97743,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -97238,10 +98058,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -97255,7 +98077,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -97268,6 +98089,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -97280,17 +98105,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -97805,10 +98636,12 @@ get formerTypes(): ($EntityType)[] { }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -97822,7 +98655,6 @@ get formerTypes(): ($EntityType)[] { if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -97835,6 +98667,10 @@ get formerTypes(): ($EntityType)[] { } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -97900,17 +98736,23 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98257,10 +99099,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98274,7 +99118,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -98287,6 +99130,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -98299,17 +99146,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98613,10 +99466,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98630,7 +99485,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -98643,6 +99497,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -98655,17 +99513,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -98967,10 +99831,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -98984,7 +99850,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -98997,6 +99862,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99009,17 +99878,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -99321,10 +100196,12 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -99338,7 +100215,6 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -99351,6 +100227,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99363,17 +100243,23 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } @@ -99671,10 +100557,12 @@ instruments?: (Object | URL)[];} }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -99688,7 +100576,6 @@ instruments?: (Object | URL)[];} if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); if ("@type" in values) { span.setAttribute("activitypub.object.type", values["@type"]); @@ -99701,6 +100588,10 @@ instruments?: (Object | URL)[];} } } + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + delete values["@type"]; const instance = await super.fromJsonLd(values, { ...options, @@ -99713,17 +100604,23 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index d33de0636..4f904533c 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -283,7 +283,7 @@ export async function* generateClasses( return { value, changed: false }; } if (Array.isArray(value)) { - let changed = false; + let clone: unknown[] | undefined; for (let i = 0; i < value.length; i++) { const result = normalizePortableIris( value[i], @@ -292,16 +292,20 @@ export async function* generateClasses( parentKey, portableIriKeys, ); - value[i] = result.value; - changed ||= result.changed; + if (result.changed) { + clone ??= value.slice(0, i); + clone.push(result.value); + } else if (clone != null) { + clone.push(value[i]); + } } - return { value, changed }; + return { value: clone ?? value, changed: clone != null }; } if (value == null || typeof value !== "object") { return { value, changed: false }; } const object = value as Record; - let changed = false; + let clone: Record | undefined; for (const entryKey of globalThis.Object.keys(object)) { const result = normalizePortableIris( object[entryKey], @@ -310,10 +314,12 @@ export async function* generateClasses( key, portableIriKeys, ); - object[entryKey] = result.value; - changed ||= result.changed; + if (result.changed) { + clone ??= { ...object }; + clone[entryKey] = result.value; + } } - return { value: object, changed }; + return { value: clone ?? object, changed: clone != null }; }\n\n`; const moduleVarNames = new Map(); const sorted = sortTopologically(types); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 2bcbb02f3..963a78b85 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -393,10 +393,12 @@ export async function* generateDecoder( }; // deno-lint-ignore no-explicit-any let values: Record & { "@id"?: string }; + let expanded: unknown[]; if (globalThis.Object.keys(json).length == 0) { values = {}; + expanded = [values]; } else { - const expanded = await jsonld.expand(json, { + expanded = await jsonld.expand(json, { documentLoader: options.contextLoader, keepFreeFloatingNodes: true, }); @@ -410,7 +412,6 @@ export async function* generateDecoder( if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } - const cacheValues = structuredClone(values); `; const subtypes = getSubtypes(typeUri, types, true); yield ` @@ -433,6 +434,11 @@ export async function* generateDecoder( } } `; + yield ` + const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + ? normalizePortableIris(expanded) + : undefined; + `; if (type.extends == null) { yield ` const instance = new this( @@ -536,17 +542,23 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - const normalizedValues = normalizePortableIris(cacheValues); - if (normalizedValues.changed) { + if (cacheJsonLd?.changed) { const context = json != null && typeof json === "object" && "@context" in json ? (json as Record)["@context"] : undefined; + const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null - ? normalizedValues.value - : await jsonld.compact(normalizedValues.value, context, { + ? normalized + : await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader: options.contextLoader, - }); + }, + ); } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index b64fce128..77f54848e 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -637,6 +637,60 @@ test("fromJsonLd() preserves extensions with portable ActivityPub IRIs", async ( deepStrictEqual(jsonLd.id, "ap+ef61://did:key:z6Mkabc/objects/1"); }); +test("fromJsonLd() preserves expanded arrays with portable IRIs", async () => { + const expanded = [ + { + "@id": "https://example.com/activities/1", + "@type": ["https://www.w3.org/ns/activitystreams#Create"], + "https://www.w3.org/ns/activitystreams#actor": [ + { "@id": "ap://did:key:z6Mkabc/actor" }, + ], + "https://www.w3.org/ns/activitystreams#object": [ + { "@id": "https://example.com/objects/1" }, + ], + }, + { + "@id": "https://example.com/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#content": [ + { "@value": "Sibling node should stay cached." }, + ], + }, + ]; + + const activity = await Activity.fromJsonLd(expanded, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual( + activity.actorId, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + ); + deepStrictEqual(await activity.toJsonLd(), [ + { + "@id": "https://example.com/activities/1", + "@type": ["https://www.w3.org/ns/activitystreams#Create"], + "https://www.w3.org/ns/activitystreams#actor": [ + { "@id": "ap+ef61://did:key:z6Mkabc/actor" }, + ], + "https://www.w3.org/ns/activitystreams#object": [ + { "@id": "https://example.com/objects/1" }, + ], + }, + { + "@id": "https://example.com/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#content": [ + { "@value": "Sibling node should stay cached." }, + ], + }, + ]); + deepStrictEqual(expanded[0]["https://www.w3.org/ns/activitystreams#actor"], [ + { "@id": "ap://did:key:z6Mkabc/actor" }, + ]); +}); + test("fromJsonLd() formats portable IRIs in JSON-LD containers", async () => { const note = await Note.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", From deba7d98f071be862ad675e1ac89632b1a20155d Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 10:20:38 +0900 Subject: [PATCH 21/55] Tighten portable IRI URL parsing Avoid overlapping DID method-specific-id matches by keeping colons as segment separators. Normalize portable string bases before resolving relative IRIs so decoded portable bases behave like parsed portable URLs. https://github.com/fedify-dev/fedify/pull/850#discussion_r3495505402 https://github.com/fedify-dev/fedify/pull/850#discussion_r3495517054 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 12 ++++++++++++ packages/vocab-runtime/src/url.ts | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 269aec3df..534f25b04 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -54,6 +54,18 @@ test("parseIri() preserves existing URL parsing behavior", () => { ok(!canParseIri("ap://not-a-did/actor")); }); +test("parseIri() resolves relative IRIs against portable string bases", () => { + ok(canParseIri("/actor", "ap://did:key:z6Mkabc/objects/1")); + deepStrictEqual( + parseIri("/actor", "ap://did:key:z6Mkabc/objects/1"), + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + ); + deepStrictEqual( + parseIri("attachments/1", "ap://did:key:z6Mkabc/objects/1"), + new URL("ap+ef61://did%3Akey%3Az6Mkabc/objects/attachments/1"), + ); +}); + test("parseIri() rejects portable IRIs without paths", () => { ok(!canParseIri("ap://did:key:z6Mkabc")); ok( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 39e79ebc9..13ad4e99b 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -14,7 +14,7 @@ const PORTABLE_IRI_PATTERN = const INVALID_PERCENT_ENCODING_PATTERN = /%(?![0-9A-Fa-f]{2})/; const DID_SCHEME_PATTERN = /^did:/i; const DID_PATTERN = - /^did:[a-z][a-z0-9]*:[A-Za-z0-9._:%-]+(?::[A-Za-z0-9._:%-]+)*$/i; + /^did:[a-z][a-z0-9]*:[A-Za-z0-9._%-]+(?::[A-Za-z0-9._%-]+)*$/i; /** * Checks whether the given string can be parsed as an IRI. @@ -37,6 +37,7 @@ export function parseIri(iri: string | URL, base?: string | URL): URL { } const portable = parsePortableIri(iri); if (portable != null) return portable; + base = normalizeBaseIri(base); if (!URL.canParse(iri, base) && iri.startsWith("at://")) { return parseAtUri(iri); } @@ -83,6 +84,12 @@ function normalizePortableUrl(iri: URL): URL | null { ); } +function normalizeBaseIri(base?: string | URL): string | URL | undefined { + if (base == null) return undefined; + if (base instanceof URL) return normalizePortableUrl(base) ?? base; + return parsePortableIri(base) ?? base; +} + function decodePortableAuthority(authority: string): string { if (INVALID_PERCENT_ENCODING_PATTERN.test(authority)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); From 33d934cf5ba1229ee5754b7514aedec10f957310 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 10:21:03 +0900 Subject: [PATCH 22/55] Preserve unmapped JSON-LD cache terms When portable IRI normalization requires expand and compact, carry back original top-level terms that JSON-LD expansion intentionally ignores. This keeps cache-only extension data round-tripping while still allowing context-aware portable IRI normalization. https://github.com/fedify-dev/fedify/pull/850#discussion_r3495517051 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 1560 ++++++++++------- .../src/__snapshots__/class.test.ts.node.snap | 1560 ++++++++++------- .../src/__snapshots__/class.test.ts.snap | 1560 ++++++++++------- packages/vocab-tools/src/class.ts | 20 + packages/vocab-tools/src/codec.ts | 19 +- packages/vocab/src/vocab.test.ts | 16 + 6 files changed, 2783 insertions(+), 1952 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 5ce42f9eb..993415d52 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -103,6 +103,27 @@ function normalizePortableIris( return { value: clone ?? object, changed: clone != null }; } +function mergeUnmappedJsonLdTerms( + compacted: unknown, + original: unknown, +): unknown { + if ( + original == null || typeof original !== \\"object\\" || + Array.isArray(original) || + compacted == null || typeof compacted !== \\"object\\" || + Array.isArray(compacted) + ) { + return compacted; + } + const result = compacted as Record; + for (const key of globalThis.Object.keys(original)) { + if (!(key in result)) { + result[key] = structuredClone((original as Record)[key]); + } + } + return result; +} + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12100,14 +12121,17 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -13324,14 +13348,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -14458,14 +14485,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -17871,14 +17901,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18388,14 +18421,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18969,14 +19005,17 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19578,14 +19617,17 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -20648,14 +20690,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21059,14 +21104,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21764,14 +21812,17 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -22499,14 +22550,17 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23580,14 +23634,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23990,14 +24047,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25004,14 +25064,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25414,14 +25477,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26427,14 +26493,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26837,14 +26906,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27334,14 +27406,17 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27683,14 +27758,17 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -28637,14 +28715,17 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -29607,14 +29688,17 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -30528,14 +30612,17 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31158,14 +31245,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31764,14 +31854,17 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -32662,14 +32755,17 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33531,14 +33627,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33978,14 +34077,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34342,14 +34444,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34705,14 +34810,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41050,14 +41158,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41897,14 +42008,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42260,14 +42374,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -43389,14 +43506,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44018,14 +44138,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44423,14 +44546,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44789,14 +44915,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -45153,14 +45282,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -49512,14 +49644,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51106,14 +51241,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51526,14 +51664,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51888,14 +52029,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52248,14 +52392,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53180,14 +53327,17 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53680,14 +53830,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54043,14 +54196,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54407,14 +54563,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -60752,14 +60911,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -62746,14 +62908,17 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63264,14 +63429,17 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63629,14 +63797,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63996,14 +64167,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64358,14 +64532,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64720,14 +64897,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65082,14 +65262,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65444,14 +65627,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65804,14 +65990,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66130,14 +66319,17 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66493,14 +66685,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -67624,14 +67819,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -68407,14 +68605,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -69247,14 +69448,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -75634,14 +75838,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -76471,14 +76678,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -82816,14 +83026,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -84223,14 +84436,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -85034,14 +85250,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -86923,14 +87142,17 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87428,14 +87650,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87794,14 +88019,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89459,14 +89687,17 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89893,14 +90124,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -96238,14 +96472,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97328,14 +97565,17 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97751,14 +97991,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98113,14 +98356,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98744,14 +98990,17 @@ get formerTypes(): (\$EntityType)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99154,14 +99403,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99521,14 +99773,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99886,14 +100141,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100251,14 +100509,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100612,14 +100873,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index a35756e3b..4bd2ad423 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -101,6 +101,27 @@ function normalizePortableIris( return { value: clone ?? object, changed: clone != null }; } +function mergeUnmappedJsonLdTerms( + compacted: unknown, + original: unknown, +): unknown { + if ( + original == null || typeof original !== \\"object\\" || + Array.isArray(original) || + compacted == null || typeof compacted !== \\"object\\" || + Array.isArray(compacted) + ) { + return compacted; + } + const result = compacted as Record; + for (const key of globalThis.Object.keys(original)) { + if (!(key in result)) { + result[key] = structuredClone((original as Record)[key]); + } + } + return result; +} + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12098,14 +12119,17 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -13322,14 +13346,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -14456,14 +14483,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -17869,14 +17899,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18386,14 +18419,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18967,14 +19003,17 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19576,14 +19615,17 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -20646,14 +20688,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21057,14 +21102,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21762,14 +21810,17 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -22497,14 +22548,17 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23578,14 +23632,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23988,14 +24045,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25002,14 +25062,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25412,14 +25475,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26425,14 +26491,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26835,14 +26904,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27332,14 +27404,17 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27681,14 +27756,17 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -28635,14 +28713,17 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -29605,14 +29686,17 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -30526,14 +30610,17 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31156,14 +31243,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31762,14 +31852,17 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -32660,14 +32753,17 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33529,14 +33625,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33976,14 +34075,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34340,14 +34442,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34703,14 +34808,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41048,14 +41156,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41895,14 +42006,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42258,14 +42372,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -43387,14 +43504,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44016,14 +44136,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44421,14 +44544,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44787,14 +44913,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -45151,14 +45280,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -49510,14 +49642,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51104,14 +51239,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51524,14 +51662,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51886,14 +52027,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52246,14 +52390,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53178,14 +53325,17 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53678,14 +53828,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54041,14 +54194,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54405,14 +54561,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -60750,14 +60909,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -62744,14 +62906,17 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63262,14 +63427,17 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63627,14 +63795,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63994,14 +64165,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64356,14 +64530,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64718,14 +64895,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65080,14 +65260,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65442,14 +65625,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65802,14 +65988,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66128,14 +66317,17 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66491,14 +66683,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -67622,14 +67817,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -68405,14 +68603,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -69245,14 +69446,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -75632,14 +75836,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -76469,14 +76676,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -82814,14 +83024,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -84221,14 +84434,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -85032,14 +85248,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -86921,14 +87140,17 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87426,14 +87648,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87792,14 +88017,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89457,14 +89685,17 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89891,14 +90122,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -96236,14 +96470,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97326,14 +97563,17 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97749,14 +97989,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98111,14 +98354,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98742,14 +98988,17 @@ get formerTypes(): ($EntityType)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99152,14 +99401,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99519,14 +99771,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99884,14 +100139,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100249,14 +100507,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100610,14 +100871,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 3b7f8a9f1..d40fbeb76 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -103,6 +103,27 @@ function normalizePortableIris( return { value: clone ?? object, changed: clone != null }; } +function mergeUnmappedJsonLdTerms( + compacted: unknown, + original: unknown, +): unknown { + if ( + original == null || typeof original !== "object" || + Array.isArray(original) || + compacted == null || typeof compacted !== "object" || + Array.isArray(compacted) + ) { + return compacted; + } + const result = compacted as Record; + for (const key of globalThis.Object.keys(original)) { + if (!(key in result)) { + result[key] = structuredClone((original as Record)[key]); + } + } + return result; +} + import * as _ppM0 from "./preprocessors.ts"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12100,14 +12121,17 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -13324,14 +13348,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -14458,14 +14485,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -17871,14 +17901,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18388,14 +18421,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18969,14 +19005,17 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19578,14 +19617,17 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -20648,14 +20690,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21059,14 +21104,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21764,14 +21812,17 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -22499,14 +22550,17 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23580,14 +23634,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23990,14 +24047,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25004,14 +25064,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25414,14 +25477,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26427,14 +26493,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26837,14 +26906,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27334,14 +27406,17 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27683,14 +27758,17 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -28637,14 +28715,17 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -29607,14 +29688,17 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -30528,14 +30612,17 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31158,14 +31245,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31764,14 +31854,17 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -32662,14 +32755,17 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33531,14 +33627,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33978,14 +34077,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34342,14 +34444,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34705,14 +34810,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41050,14 +41158,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41897,14 +42008,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42260,14 +42374,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -43389,14 +43506,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44018,14 +44138,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44423,14 +44546,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44789,14 +44915,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -45153,14 +45282,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -49512,14 +49644,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51106,14 +51241,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51526,14 +51664,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51888,14 +52029,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52248,14 +52392,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53180,14 +53327,17 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53680,14 +53830,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54043,14 +54196,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54407,14 +54563,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -60752,14 +60911,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -62746,14 +62908,17 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63264,14 +63429,17 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63629,14 +63797,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63996,14 +64167,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64358,14 +64532,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64720,14 +64897,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65082,14 +65262,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65444,14 +65627,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65804,14 +65990,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66130,14 +66319,17 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66493,14 +66685,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -67624,14 +67819,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -68407,14 +68605,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -69247,14 +69448,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -75634,14 +75838,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -76471,14 +76678,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -82816,14 +83026,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -84223,14 +84436,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -85034,14 +85250,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -86923,14 +87142,17 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87428,14 +87650,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87794,14 +88019,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89459,14 +89687,17 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89893,14 +90124,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -96238,14 +96472,17 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97328,14 +97565,17 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97751,14 +97991,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98113,14 +98356,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98744,14 +98990,17 @@ get formerTypes(): ($EntityType)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99154,14 +99403,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99521,14 +99773,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99886,14 +100141,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100251,14 +100509,17 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100612,14 +100873,17 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 4f904533c..f8f8b6630 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -320,6 +320,26 @@ export async function* generateClasses( } } return { value: clone ?? object, changed: clone != null }; +}\n\n`; + yield `function mergeUnmappedJsonLdTerms( + compacted: unknown, + original: unknown, +): unknown { + if ( + original == null || typeof original !== "object" || + Array.isArray(original) || + compacted == null || typeof compacted !== "object" || + Array.isArray(compacted) + ) { + return compacted; + } + const result = compacted as Record; + for (const key of globalThis.Object.keys(original)) { + if (!(key in result)) { + result[key] = structuredClone((original as Record)[key]); + } + } + return result; }\n\n`; const moduleVarNames = new Map(); const sorted = sortTopologically(types); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 963a78b85..89b893a66 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -550,14 +550,17 @@ export async function* generateDecoder( const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, + : mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + json, ); } else { instance._cachedJsonLd = structuredClone(json); diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 77f54848e..23a3049d0 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -637,6 +637,22 @@ test("fromJsonLd() preserves extensions with portable ActivityPub IRIs", async ( deepStrictEqual(jsonLd.id, "ap+ef61://did:key:z6Mkabc/objects/1"); }); +test("fromJsonLd() preserves unmapped terms with portable IRIs", async () => { + const note = await Note.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: "ap://did:key:z6Mkabc/objects/1", + extra: "This unmapped property should stay cached.", + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + + const jsonLd = await note.toJsonLd() as Record; + deepStrictEqual( + jsonLd.extra, + "This unmapped property should stay cached.", + ); + deepStrictEqual(jsonLd.id, "ap+ef61://did:key:z6Mkabc/objects/1"); +}); + test("fromJsonLd() preserves expanded arrays with portable IRIs", async () => { const expanded = [ { From b1ec3014b2a08f7517dc17ccb233583da0717c59 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 10:51:51 +0900 Subject: [PATCH 23/55] Skip represented JSON-LD cache terms When compacted cache data already represents an original JSON-LD term through a canonical alias, do not copy the original alias back as an unmapped extension field. This keeps portable IRI normalization from leaving duplicate alias keys in the cached document. https://github.com/fedify-dev/fedify/pull/850#discussion_r3495621720 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 211 +++++++++++++++++- .../src/__snapshots__/class.test.ts.node.snap | 211 +++++++++++++++++- .../src/__snapshots__/class.test.ts.snap | 211 +++++++++++++++++- packages/vocab-tools/src/class.ts | 47 +++- packages/vocab-tools/src/codec.ts | 2 + packages/vocab/src/vocab.test.ts | 2 + 6 files changed, 668 insertions(+), 16 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 993415d52..ba62af106 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -103,10 +103,44 @@ function normalizePortableIris( return { value: clone ?? object, changed: clone != null }; } -function mergeUnmappedJsonLdTerms( +function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { + const terms = new Set(); + const nodes = Array.isArray(value) ? value : [value]; + for (const node of nodes) { + if (node == null || typeof node !== \\"object\\" || Array.isArray(node)) { + continue; + } + for (const key of globalThis.Object.keys(node)) { + if (key.startsWith(\\"@\\")) continue; + terms.add(key); + } + } + return terms; +} + +async function isJsonLdTermRepresented( + key: string, + value: unknown, + context: unknown, + compactedTerms: ReadonlySet, + documentLoader?: DocumentLoader, +): Promise { + if (key === \\"@context\\") return true; + const expanded = await jsonld.expand({ \\"@context\\": context, [key]: value }, { + documentLoader, + }); + for (const term of getTopLevelJsonLdTerms(expanded)) { + if (compactedTerms.has(term)) return true; + } + return false; +} + +async function mergeUnmappedJsonLdTerms( compacted: unknown, original: unknown, -): unknown { + context: unknown, + documentLoader?: DocumentLoader, +): Promise { if ( original == null || typeof original !== \\"object\\" || Array.isArray(original) || @@ -116,9 +150,16 @@ function mergeUnmappedJsonLdTerms( return compacted; } const result = compacted as Record; + const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { + documentLoader, + })); for (const key of globalThis.Object.keys(original)) { - if (!(key in result)) { - result[key] = structuredClone((original as Record)[key]); + const value = (original as Record)[key]; + if ( + !(key in result) && + !await isJsonLdTermRepresented(key, value, context, compactedTerms, documentLoader) + ) { + result[key] = structuredClone(value); } } return result; @@ -12132,6 +12173,8 @@ get urls(): ((URL | Link))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -13359,6 +13402,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -14496,6 +14541,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -17912,6 +17959,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18432,6 +18481,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19016,6 +19067,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19628,6 +19681,8 @@ unit?: string | null;numericalValue?: Decimal | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -20701,6 +20756,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21115,6 +21172,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21823,6 +21882,8 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -22561,6 +22622,8 @@ get manualApprovals(): (URL)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23645,6 +23708,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -24058,6 +24123,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25075,6 +25142,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25488,6 +25557,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26504,6 +26575,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26917,6 +26990,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27417,6 +27492,8 @@ get endpoints(): (URL)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27769,6 +27846,8 @@ endpoints?: (URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -28726,6 +28805,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -29699,6 +29780,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -30623,6 +30706,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31256,6 +31341,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31865,6 +31952,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -32766,6 +32855,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33638,6 +33729,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34088,6 +34181,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34455,6 +34550,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34821,6 +34918,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41169,6 +41268,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42019,6 +42120,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42385,6 +42488,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -43517,6 +43622,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44149,6 +44256,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44557,6 +44666,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44926,6 +45037,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -45293,6 +45406,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -49655,6 +49770,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51252,6 +51369,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51675,6 +51794,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52040,6 +52161,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52403,6 +52526,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53338,6 +53463,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53841,6 +53968,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54207,6 +54336,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54574,6 +54705,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -60922,6 +61055,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -62919,6 +63054,8 @@ get names(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63440,6 +63577,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63808,6 +63947,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64178,6 +64319,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64543,6 +64686,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64908,6 +65053,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65273,6 +65420,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65638,6 +65787,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66001,6 +66152,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66330,6 +66483,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66696,6 +66851,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -67830,6 +67987,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -68616,6 +68775,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -69459,6 +69620,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -75849,6 +76012,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -76689,6 +76854,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -83037,6 +83204,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -84447,6 +84616,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -85261,6 +85432,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87153,6 +87326,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87661,6 +87836,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -88030,6 +88207,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89698,6 +89877,8 @@ relationships?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -90135,6 +90316,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -96483,6 +96666,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97576,6 +97761,8 @@ get contents(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98002,6 +98189,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98367,6 +98556,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99001,6 +99192,8 @@ get formerTypes(): (\$EntityType)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99414,6 +99607,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99784,6 +99979,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100152,6 +100349,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100520,6 +100719,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100884,6 +101085,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 4bd2ad423..7aabb786c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -101,10 +101,44 @@ function normalizePortableIris( return { value: clone ?? object, changed: clone != null }; } -function mergeUnmappedJsonLdTerms( +function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { + const terms = new Set(); + const nodes = Array.isArray(value) ? value : [value]; + for (const node of nodes) { + if (node == null || typeof node !== \\"object\\" || Array.isArray(node)) { + continue; + } + for (const key of globalThis.Object.keys(node)) { + if (key.startsWith(\\"@\\")) continue; + terms.add(key); + } + } + return terms; +} + +async function isJsonLdTermRepresented( + key: string, + value: unknown, + context: unknown, + compactedTerms: ReadonlySet, + documentLoader?: DocumentLoader, +): Promise { + if (key === \\"@context\\") return true; + const expanded = await jsonld.expand({ \\"@context\\": context, [key]: value }, { + documentLoader, + }); + for (const term of getTopLevelJsonLdTerms(expanded)) { + if (compactedTerms.has(term)) return true; + } + return false; +} + +async function mergeUnmappedJsonLdTerms( compacted: unknown, original: unknown, -): unknown { + context: unknown, + documentLoader?: DocumentLoader, +): Promise { if ( original == null || typeof original !== \\"object\\" || Array.isArray(original) || @@ -114,9 +148,16 @@ function mergeUnmappedJsonLdTerms( return compacted; } const result = compacted as Record; + const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { + documentLoader, + })); for (const key of globalThis.Object.keys(original)) { - if (!(key in result)) { - result[key] = structuredClone((original as Record)[key]); + const value = (original as Record)[key]; + if ( + !(key in result) && + !await isJsonLdTermRepresented(key, value, context, compactedTerms, documentLoader) + ) { + result[key] = structuredClone(value); } } return result; @@ -12130,6 +12171,8 @@ get urls(): ((URL | Link))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -13357,6 +13400,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -14494,6 +14539,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -17910,6 +17957,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18430,6 +18479,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19014,6 +19065,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19626,6 +19679,8 @@ unit?: string | null;numericalValue?: Decimal | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -20699,6 +20754,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21113,6 +21170,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21821,6 +21880,8 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -22559,6 +22620,8 @@ get manualApprovals(): (URL)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23643,6 +23706,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -24056,6 +24121,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25073,6 +25140,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25486,6 +25555,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26502,6 +26573,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26915,6 +26988,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27415,6 +27490,8 @@ get endpoints(): (URL)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27767,6 +27844,8 @@ endpoints?: (URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -28724,6 +28803,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -29697,6 +29778,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -30621,6 +30704,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31254,6 +31339,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31863,6 +31950,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -32764,6 +32853,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33636,6 +33727,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34086,6 +34179,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34453,6 +34548,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34819,6 +34916,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41167,6 +41266,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42017,6 +42118,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42383,6 +42486,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -43515,6 +43620,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44147,6 +44254,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44555,6 +44664,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44924,6 +45035,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -45291,6 +45404,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -49653,6 +49768,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51250,6 +51367,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51673,6 +51792,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52038,6 +52159,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52401,6 +52524,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53336,6 +53461,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53839,6 +53966,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54205,6 +54334,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54572,6 +54703,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -60920,6 +61053,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -62917,6 +63052,8 @@ get names(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63438,6 +63575,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63806,6 +63945,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64176,6 +64317,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64541,6 +64684,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64906,6 +65051,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65271,6 +65418,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65636,6 +65785,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65999,6 +66150,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66328,6 +66481,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66694,6 +66849,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -67828,6 +67985,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -68614,6 +68773,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -69457,6 +69618,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -75847,6 +76010,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -76687,6 +76852,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -83035,6 +83202,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -84445,6 +84614,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -85259,6 +85430,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87151,6 +87324,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87659,6 +87834,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -88028,6 +88205,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89696,6 +89875,8 @@ relationships?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -90133,6 +90314,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -96481,6 +96664,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97574,6 +97759,8 @@ get contents(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98000,6 +98187,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98365,6 +98554,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98999,6 +99190,8 @@ get formerTypes(): ($EntityType)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99412,6 +99605,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99782,6 +99977,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100150,6 +100347,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100518,6 +100717,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100882,6 +101083,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index d40fbeb76..2cad0d38f 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -103,10 +103,44 @@ function normalizePortableIris( return { value: clone ?? object, changed: clone != null }; } -function mergeUnmappedJsonLdTerms( +function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { + const terms = new Set(); + const nodes = Array.isArray(value) ? value : [value]; + for (const node of nodes) { + if (node == null || typeof node !== "object" || Array.isArray(node)) { + continue; + } + for (const key of globalThis.Object.keys(node)) { + if (key.startsWith("@")) continue; + terms.add(key); + } + } + return terms; +} + +async function isJsonLdTermRepresented( + key: string, + value: unknown, + context: unknown, + compactedTerms: ReadonlySet, + documentLoader?: DocumentLoader, +): Promise { + if (key === "@context") return true; + const expanded = await jsonld.expand({ "@context": context, [key]: value }, { + documentLoader, + }); + for (const term of getTopLevelJsonLdTerms(expanded)) { + if (compactedTerms.has(term)) return true; + } + return false; +} + +async function mergeUnmappedJsonLdTerms( compacted: unknown, original: unknown, -): unknown { + context: unknown, + documentLoader?: DocumentLoader, +): Promise { if ( original == null || typeof original !== "object" || Array.isArray(original) || @@ -116,9 +150,16 @@ function mergeUnmappedJsonLdTerms( return compacted; } const result = compacted as Record; + const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { + documentLoader, + })); for (const key of globalThis.Object.keys(original)) { - if (!(key in result)) { - result[key] = structuredClone((original as Record)[key]); + const value = (original as Record)[key]; + if ( + !(key in result) && + !await isJsonLdTermRepresented(key, value, context, compactedTerms, documentLoader) + ) { + result[key] = structuredClone(value); } } return result; @@ -12132,6 +12173,8 @@ get urls(): ((URL | Link))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -13359,6 +13402,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -14496,6 +14541,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -17912,6 +17959,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -18432,6 +18481,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19016,6 +19067,8 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -19628,6 +19681,8 @@ unit?: string | null;numericalValue?: Decimal | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -20701,6 +20756,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21115,6 +21172,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -21823,6 +21882,8 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -22561,6 +22622,8 @@ get manualApprovals(): (URL)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -23645,6 +23708,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -24058,6 +24123,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25075,6 +25142,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -25488,6 +25557,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26504,6 +26575,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -26917,6 +26990,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27417,6 +27492,8 @@ get endpoints(): (URL)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -27769,6 +27846,8 @@ endpoints?: (URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -28726,6 +28805,8 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -29699,6 +29780,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -30623,6 +30706,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31256,6 +31341,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -31865,6 +31952,8 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -32766,6 +32855,8 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -33638,6 +33729,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34088,6 +34181,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34455,6 +34550,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -34821,6 +34918,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -41169,6 +41268,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42019,6 +42120,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -42385,6 +42488,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -43517,6 +43622,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44149,6 +44256,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44557,6 +44666,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -44926,6 +45037,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -45293,6 +45406,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -49655,6 +49770,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51252,6 +51369,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -51675,6 +51794,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52040,6 +52161,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -52403,6 +52526,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53338,6 +53463,8 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -53841,6 +53968,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54207,6 +54336,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -54574,6 +54705,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -60922,6 +61055,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -62919,6 +63054,8 @@ get names(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63440,6 +63577,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -63808,6 +63947,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64178,6 +64319,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64543,6 +64686,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -64908,6 +65053,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65273,6 +65420,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -65638,6 +65787,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66001,6 +66152,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66330,6 +66483,8 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -66696,6 +66851,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -67830,6 +67987,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -68616,6 +68775,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -69459,6 +69620,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -75849,6 +76012,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -76689,6 +76854,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -83037,6 +83204,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -84447,6 +84616,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -85261,6 +85432,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87153,6 +87326,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -87661,6 +87836,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -88030,6 +88207,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -89698,6 +89877,8 @@ relationships?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -90135,6 +90316,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -96483,6 +96666,8 @@ get preferredUsernames(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -97576,6 +97761,8 @@ get contents(): ((string | LanguageString))[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98002,6 +98189,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -98367,6 +98556,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99001,6 +99192,8 @@ get formerTypes(): ($EntityType)[] { }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99414,6 +99607,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -99784,6 +99979,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100152,6 +100349,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100520,6 +100719,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); @@ -100884,6 +101085,8 @@ instruments?: (Object | URL)[];} }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index f8f8b6630..f57fb6a7d 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -321,10 +321,42 @@ export async function* generateClasses( } return { value: clone ?? object, changed: clone != null }; }\n\n`; - yield `function mergeUnmappedJsonLdTerms( + yield `function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { + const terms = new Set(); + const nodes = Array.isArray(value) ? value : [value]; + for (const node of nodes) { + if (node == null || typeof node !== "object" || Array.isArray(node)) { + continue; + } + for (const key of globalThis.Object.keys(node)) { + if (key.startsWith("@")) continue; + terms.add(key); + } + } + return terms; +}\n\n`; + yield `async function isJsonLdTermRepresented( + key: string, + value: unknown, + context: unknown, + compactedTerms: ReadonlySet, + documentLoader?: DocumentLoader, +): Promise { + if (key === "@context") return true; + const expanded = await jsonld.expand({ "@context": context, [key]: value }, { + documentLoader, + }); + for (const term of getTopLevelJsonLdTerms(expanded)) { + if (compactedTerms.has(term)) return true; + } + return false; +}\n\n`; + yield `async function mergeUnmappedJsonLdTerms( compacted: unknown, original: unknown, -): unknown { + context: unknown, + documentLoader?: DocumentLoader, +): Promise { if ( original == null || typeof original !== "object" || Array.isArray(original) || @@ -334,9 +366,16 @@ export async function* generateClasses( return compacted; } const result = compacted as Record; + const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { + documentLoader, + })); for (const key of globalThis.Object.keys(original)) { - if (!(key in result)) { - result[key] = structuredClone((original as Record)[key]); + const value = (original as Record)[key]; + if ( + !(key in result) && + !await isJsonLdTermRepresented(key, value, context, compactedTerms, documentLoader) + ) { + result[key] = structuredClone(value); } } return result; diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 89b893a66..f2c8d0339 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -561,6 +561,8 @@ export async function* generateDecoder( }, ), json, + context, + options.contextLoader, ); } else { instance._cachedJsonLd = structuredClone(json); diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 23a3049d0..2d3a3df1e 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -771,7 +771,9 @@ test("fromJsonLd() formats portable IRIs hidden behind JSON-LD aliases", async ( contextLoader: mockDocumentLoader, }) as Record; deepStrictEqual(jsonLd.actor, "ap+ef61://did:key:z6Mkabc/actor"); + deepStrictEqual("actorRef" in jsonLd, false); deepStrictEqual(jsonLd.target, "ap+ef61://did:key:z6Mkabc/target"); + deepStrictEqual("targetRef" in jsonLd, false); deepStrictEqual(jsonLd.extra, "This extension property should stay cached."); deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); }); From f4d4dd8ece9533339969fbd15a028715f7812e18 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 12:25:12 +0900 Subject: [PATCH 24/55] Recheck decoded portable IRI escapes Validate portable IRI authorities again after decoding encoded colons and percent signs. This keeps encoded DID authorities from accepting invalid percent escapes that the decoded spelling would reject. https://github.com/fedify-dev/fedify/pull/850#discussion_r3495724772 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 1 + packages/vocab-runtime/src/url.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 534f25b04..1f4a55e63 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -79,6 +79,7 @@ test("parseIri() rejects malformed portable DID authorities", () => { "ap://did:/actor", "ap://did:key/actor", "ap://did:123:abc/actor", + "ap://did%3Akey%3Aabc%25zz/actor", ]; for (const iri of cases) { ok(!canParseIri(iri)); diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 13ad4e99b..ae2680786 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -95,7 +95,11 @@ function decodePortableAuthority(authority: string): string { throw new TypeError("Invalid portable ActivityPub IRI authority."); } if (DID_SCHEME_PATTERN.test(authority)) return authority; - return authority.replace(/%3A/gi, ":").replace(/%25/gi, "%"); + const decoded = authority.replace(/%3A/gi, ":").replace(/%25/gi, "%"); + if (INVALID_PERCENT_ENCODING_PATTERN.test(decoded)) { + throw new TypeError("Invalid portable ActivityPub IRI authority."); + } + return decoded; } function parseAtUri(uri: string): URL { From f9f2bac69674fb868f8fcf2ce344af8816dbb570 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 12:44:46 +0900 Subject: [PATCH 25/55] Batch portable IRI cache merge checks Batch unmapped JSON-LD term checks into a single expansion so portable IRI cache merging does not expand each original key separately. Also await the merge before assigning the cached JSON-LD value so merge failures stay inside the cache fallback path. https://github.com/fedify-dev/fedify/pull/850#discussion_r3495971756 https://github.com/fedify-dev/fedify/pull/850#discussion_r3495980707 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 214 +++++++++--------- .../src/__snapshots__/class.test.ts.node.snap | 214 +++++++++--------- .../src/__snapshots__/class.test.ts.snap | 214 +++++++++--------- packages/vocab-tools/src/class.ts | 51 +++-- packages/vocab-tools/src/codec.ts | 2 +- packages/vocab/src/vocab.test.ts | 92 ++++++++ 6 files changed, 452 insertions(+), 335 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index ba62af106..29dc539be 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -118,23 +118,6 @@ function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { return terms; } -async function isJsonLdTermRepresented( - key: string, - value: unknown, - context: unknown, - compactedTerms: ReadonlySet, - documentLoader?: DocumentLoader, -): Promise { - if (key === \\"@context\\") return true; - const expanded = await jsonld.expand({ \\"@context\\": context, [key]: value }, { - documentLoader, - }); - for (const term of getTopLevelJsonLdTerms(expanded)) { - if (compactedTerms.has(term)) return true; - } - return false; -} - async function mergeUnmappedJsonLdTerms( compacted: unknown, original: unknown, @@ -150,15 +133,38 @@ async function mergeUnmappedJsonLdTerms( return compacted; } const result = compacted as Record; + const unmappedKeys = globalThis.Object.keys(original).filter((key) => + key !== \\"@context\\" && !(key in result) + ); + if (unmappedKeys.length < 1) return result; const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { documentLoader, })); - for (const key of globalThis.Object.keys(original)) { - const value = (original as Record)[key]; - if ( - !(key in result) && - !await isJsonLdTermRepresented(key, value, context, compactedTerms, documentLoader) - ) { + const dummyPrefix = \\"urn:fedify:dummy:\\"; + const dummy: Record = { \\"@context\\": context }; + for (let i = 0; i < unmappedKeys.length; i++) { + dummy[unmappedKeys[i]] = \`\${dummyPrefix}\${i}\`; + } + const expanded = await jsonld.expand(dummy, { documentLoader }); + const representedKeys = new Set(); + const nodes = Array.isArray(expanded) ? expanded : [expanded]; + for (const node of nodes) { + if (node == null || typeof node !== \\"object\\" || Array.isArray(node)) { + continue; + } + for (const [term, termValue] of globalThis.Object.entries(node)) { + if (!compactedTerms.has(term)) continue; + const value = JSON.stringify(termValue); + for (let i = 0; i < unmappedKeys.length; i++) { + if (value.includes(\`\${dummyPrefix}\${i}\`)) { + representedKeys.add(unmappedKeys[i]); + } + } + } + } + for (const key of unmappedKeys) { + if (!representedKeys.has(key)) { + const value = (original as Record)[key]; result[key] = structuredClone(value); } } @@ -12162,7 +12168,7 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -13391,7 +13397,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -14530,7 +14536,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -17948,7 +17954,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -18470,7 +18476,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -19056,7 +19062,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -19670,7 +19676,7 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -20745,7 +20751,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -21161,7 +21167,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -21871,7 +21877,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -22611,7 +22617,7 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -23697,7 +23703,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -24112,7 +24118,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -25131,7 +25137,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -25546,7 +25552,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -26564,7 +26570,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -26979,7 +26985,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -27481,7 +27487,7 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -27835,7 +27841,7 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -28794,7 +28800,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -29769,7 +29775,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -30695,7 +30701,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -31330,7 +31336,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -31941,7 +31947,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -32844,7 +32850,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -33718,7 +33724,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34170,7 +34176,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34539,7 +34545,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34907,7 +34913,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -41257,7 +41263,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -42109,7 +42115,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -42477,7 +42483,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -43611,7 +43617,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -44245,7 +44251,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -44655,7 +44661,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -45026,7 +45032,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -45395,7 +45401,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -49759,7 +49765,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -51358,7 +51364,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -51783,7 +51789,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -52150,7 +52156,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -52515,7 +52521,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -53452,7 +53458,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -53957,7 +53963,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -54325,7 +54331,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -54694,7 +54700,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -61044,7 +61050,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63043,7 +63049,7 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63566,7 +63572,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63936,7 +63942,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -64308,7 +64314,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -64675,7 +64681,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65042,7 +65048,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65409,7 +65415,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65776,7 +65782,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66141,7 +66147,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66472,7 +66478,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66840,7 +66846,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -67976,7 +67982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -68764,7 +68770,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -69609,7 +69615,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -76001,7 +76007,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -76843,7 +76849,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -83193,7 +83199,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -84605,7 +84611,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -85421,7 +85427,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -87315,7 +87321,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -87825,7 +87831,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -88196,7 +88202,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -89866,7 +89872,7 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -90305,7 +90311,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -96655,7 +96661,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -97750,7 +97756,7 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -98178,7 +98184,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -98545,7 +98551,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99181,7 +99187,7 @@ get formerTypes(): (\$EntityType)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99596,7 +99602,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99968,7 +99974,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -100338,7 +100344,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -100708,7 +100714,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -101074,7 +101080,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 7aabb786c..5586f7cdd 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -116,23 +116,6 @@ function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { return terms; } -async function isJsonLdTermRepresented( - key: string, - value: unknown, - context: unknown, - compactedTerms: ReadonlySet, - documentLoader?: DocumentLoader, -): Promise { - if (key === \\"@context\\") return true; - const expanded = await jsonld.expand({ \\"@context\\": context, [key]: value }, { - documentLoader, - }); - for (const term of getTopLevelJsonLdTerms(expanded)) { - if (compactedTerms.has(term)) return true; - } - return false; -} - async function mergeUnmappedJsonLdTerms( compacted: unknown, original: unknown, @@ -148,15 +131,38 @@ async function mergeUnmappedJsonLdTerms( return compacted; } const result = compacted as Record; + const unmappedKeys = globalThis.Object.keys(original).filter((key) => + key !== \\"@context\\" && !(key in result) + ); + if (unmappedKeys.length < 1) return result; const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { documentLoader, })); - for (const key of globalThis.Object.keys(original)) { - const value = (original as Record)[key]; - if ( - !(key in result) && - !await isJsonLdTermRepresented(key, value, context, compactedTerms, documentLoader) - ) { + const dummyPrefix = \\"urn:fedify:dummy:\\"; + const dummy: Record = { \\"@context\\": context }; + for (let i = 0; i < unmappedKeys.length; i++) { + dummy[unmappedKeys[i]] = \`\${dummyPrefix}\${i}\`; + } + const expanded = await jsonld.expand(dummy, { documentLoader }); + const representedKeys = new Set(); + const nodes = Array.isArray(expanded) ? expanded : [expanded]; + for (const node of nodes) { + if (node == null || typeof node !== \\"object\\" || Array.isArray(node)) { + continue; + } + for (const [term, termValue] of globalThis.Object.entries(node)) { + if (!compactedTerms.has(term)) continue; + const value = JSON.stringify(termValue); + for (let i = 0; i < unmappedKeys.length; i++) { + if (value.includes(\`\${dummyPrefix}\${i}\`)) { + representedKeys.add(unmappedKeys[i]); + } + } + } + } + for (const key of unmappedKeys) { + if (!representedKeys.has(key)) { + const value = (original as Record)[key]; result[key] = structuredClone(value); } } @@ -12160,7 +12166,7 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -13389,7 +13395,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -14528,7 +14534,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -17946,7 +17952,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -18468,7 +18474,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -19054,7 +19060,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -19668,7 +19674,7 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -20743,7 +20749,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -21159,7 +21165,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -21869,7 +21875,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -22609,7 +22615,7 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -23695,7 +23701,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -24110,7 +24116,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -25129,7 +25135,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -25544,7 +25550,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -26562,7 +26568,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -26977,7 +26983,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -27479,7 +27485,7 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -27833,7 +27839,7 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -28792,7 +28798,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -29767,7 +29773,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -30693,7 +30699,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -31328,7 +31334,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -31939,7 +31945,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -32842,7 +32848,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -33716,7 +33722,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34168,7 +34174,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34537,7 +34543,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34905,7 +34911,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -41255,7 +41261,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -42107,7 +42113,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -42475,7 +42481,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -43609,7 +43615,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -44243,7 +44249,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -44653,7 +44659,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -45024,7 +45030,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -45393,7 +45399,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -49757,7 +49763,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -51356,7 +51362,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -51781,7 +51787,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -52148,7 +52154,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -52513,7 +52519,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -53450,7 +53456,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -53955,7 +53961,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -54323,7 +54329,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -54692,7 +54698,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -61042,7 +61048,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63041,7 +63047,7 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63564,7 +63570,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63934,7 +63940,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -64306,7 +64312,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -64673,7 +64679,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65040,7 +65046,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65407,7 +65413,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65774,7 +65780,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66139,7 +66145,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66470,7 +66476,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66838,7 +66844,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -67974,7 +67980,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -68762,7 +68768,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -69607,7 +69613,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -75999,7 +76005,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -76841,7 +76847,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -83191,7 +83197,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -84603,7 +84609,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -85419,7 +85425,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -87313,7 +87319,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -87823,7 +87829,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -88194,7 +88200,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -89864,7 +89870,7 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -90303,7 +90309,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -96653,7 +96659,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -97748,7 +97754,7 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -98176,7 +98182,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -98543,7 +98549,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99179,7 +99185,7 @@ get formerTypes(): ($EntityType)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99594,7 +99600,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99966,7 +99972,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -100336,7 +100342,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -100706,7 +100712,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -101072,7 +101078,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 2cad0d38f..7647cbed4 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -118,23 +118,6 @@ function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { return terms; } -async function isJsonLdTermRepresented( - key: string, - value: unknown, - context: unknown, - compactedTerms: ReadonlySet, - documentLoader?: DocumentLoader, -): Promise { - if (key === "@context") return true; - const expanded = await jsonld.expand({ "@context": context, [key]: value }, { - documentLoader, - }); - for (const term of getTopLevelJsonLdTerms(expanded)) { - if (compactedTerms.has(term)) return true; - } - return false; -} - async function mergeUnmappedJsonLdTerms( compacted: unknown, original: unknown, @@ -150,15 +133,38 @@ async function mergeUnmappedJsonLdTerms( return compacted; } const result = compacted as Record; + const unmappedKeys = globalThis.Object.keys(original).filter((key) => + key !== "@context" && !(key in result) + ); + if (unmappedKeys.length < 1) return result; const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { documentLoader, })); - for (const key of globalThis.Object.keys(original)) { - const value = (original as Record)[key]; - if ( - !(key in result) && - !await isJsonLdTermRepresented(key, value, context, compactedTerms, documentLoader) - ) { + const dummyPrefix = "urn:fedify:dummy:"; + const dummy: Record = { "@context": context }; + for (let i = 0; i < unmappedKeys.length; i++) { + dummy[unmappedKeys[i]] = \`\${dummyPrefix}\${i}\`; + } + const expanded = await jsonld.expand(dummy, { documentLoader }); + const representedKeys = new Set(); + const nodes = Array.isArray(expanded) ? expanded : [expanded]; + for (const node of nodes) { + if (node == null || typeof node !== "object" || Array.isArray(node)) { + continue; + } + for (const [term, termValue] of globalThis.Object.entries(node)) { + if (!compactedTerms.has(term)) continue; + const value = JSON.stringify(termValue); + for (let i = 0; i < unmappedKeys.length; i++) { + if (value.includes(\`\${dummyPrefix}\${i}\`)) { + representedKeys.add(unmappedKeys[i]); + } + } + } + } + for (const key of unmappedKeys) { + if (!representedKeys.has(key)) { + const value = (original as Record)[key]; result[key] = structuredClone(value); } } @@ -12162,7 +12168,7 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -13391,7 +13397,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -14530,7 +14536,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -17948,7 +17954,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -18470,7 +18476,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -19056,7 +19062,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -19670,7 +19676,7 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -20745,7 +20751,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -21161,7 +21167,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -21871,7 +21877,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -22611,7 +22617,7 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -23697,7 +23703,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -24112,7 +24118,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -25131,7 +25137,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -25546,7 +25552,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -26564,7 +26570,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -26979,7 +26985,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -27481,7 +27487,7 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -27835,7 +27841,7 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -28794,7 +28800,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -29769,7 +29775,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -30695,7 +30701,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -31330,7 +31336,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -31941,7 +31947,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -32844,7 +32850,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -33718,7 +33724,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34170,7 +34176,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34539,7 +34545,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -34907,7 +34913,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -41257,7 +41263,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -42109,7 +42115,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -42477,7 +42483,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -43611,7 +43617,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -44245,7 +44251,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -44655,7 +44661,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -45026,7 +45032,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -45395,7 +45401,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -49759,7 +49765,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -51358,7 +51364,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -51783,7 +51789,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -52150,7 +52156,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -52515,7 +52521,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -53452,7 +53458,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -53957,7 +53963,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -54325,7 +54331,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -54694,7 +54700,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -61044,7 +61050,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63043,7 +63049,7 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63566,7 +63572,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -63936,7 +63942,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -64308,7 +64314,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -64675,7 +64681,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65042,7 +65048,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65409,7 +65415,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -65776,7 +65782,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66141,7 +66147,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66472,7 +66478,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -66840,7 +66846,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -67976,7 +67982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -68764,7 +68770,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -69609,7 +69615,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -76001,7 +76007,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -76843,7 +76849,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -83193,7 +83199,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -84605,7 +84611,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -85421,7 +85427,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -87315,7 +87321,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -87825,7 +87831,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -88196,7 +88202,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -89866,7 +89872,7 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -90305,7 +90311,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -96655,7 +96661,7 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -97750,7 +97756,7 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -98178,7 +98184,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -98545,7 +98551,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99181,7 +99187,7 @@ get formerTypes(): ($EntityType)[] { const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99596,7 +99602,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -99968,7 +99974,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -100338,7 +100344,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -100708,7 +100714,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] @@ -101074,7 +101080,7 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index f57fb6a7d..64d921cd5 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -334,22 +334,6 @@ export async function* generateClasses( } } return terms; -}\n\n`; - yield `async function isJsonLdTermRepresented( - key: string, - value: unknown, - context: unknown, - compactedTerms: ReadonlySet, - documentLoader?: DocumentLoader, -): Promise { - if (key === "@context") return true; - const expanded = await jsonld.expand({ "@context": context, [key]: value }, { - documentLoader, - }); - for (const term of getTopLevelJsonLdTerms(expanded)) { - if (compactedTerms.has(term)) return true; - } - return false; }\n\n`; yield `async function mergeUnmappedJsonLdTerms( compacted: unknown, @@ -366,15 +350,38 @@ export async function* generateClasses( return compacted; } const result = compacted as Record; + const unmappedKeys = globalThis.Object.keys(original).filter((key) => + key !== "@context" && !(key in result) + ); + if (unmappedKeys.length < 1) return result; const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { documentLoader, })); - for (const key of globalThis.Object.keys(original)) { - const value = (original as Record)[key]; - if ( - !(key in result) && - !await isJsonLdTermRepresented(key, value, context, compactedTerms, documentLoader) - ) { + const dummyPrefix = "urn:fedify:dummy:"; + const dummy: Record = { "@context": context }; + for (let i = 0; i < unmappedKeys.length; i++) { + dummy[unmappedKeys[i]] = \`\${dummyPrefix}\${i}\`; + } + const expanded = await jsonld.expand(dummy, { documentLoader }); + const representedKeys = new Set(); + const nodes = Array.isArray(expanded) ? expanded : [expanded]; + for (const node of nodes) { + if (node == null || typeof node !== "object" || Array.isArray(node)) { + continue; + } + for (const [term, termValue] of globalThis.Object.entries(node)) { + if (!compactedTerms.has(term)) continue; + const value = JSON.stringify(termValue); + for (let i = 0; i < unmappedKeys.length; i++) { + if (value.includes(\`\${dummyPrefix}\${i}\`)) { + representedKeys.add(unmappedKeys[i]); + } + } + } + } + for (const key of unmappedKeys) { + if (!representedKeys.has(key)) { + const value = (original as Record)[key]; result[key] = structuredClone(value); } } diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index f2c8d0339..ba24e4e9b 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -550,7 +550,7 @@ export async function* generateDecoder( const normalized = cacheJsonLd.value; instance._cachedJsonLd = context == null ? normalized - : mergeUnmappedJsonLdTerms( + : await mergeUnmappedJsonLdTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 ? normalized[0] diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 2d3a3df1e..656e43bf6 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -994,6 +994,98 @@ test("fromJsonLd() formats portable IRIs in sibling remote-context objects", asy }); }); +test("fromJsonLd() batches unmapped portable IRI term checks", async () => { + const contextUrl = "https://example.com/contexts/batched-portable-aliases"; + let contextLoads = 0; + const contextLoader: DocumentLoader = async ( + resource: string, + options, + ): Promise => { + if (resource === contextUrl) { + contextLoads++; + return { + contextUrl: null, + documentUrl: resource, + document: { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + as: { + "@id": "https://www.w3.org/ns/activitystreams#", + "@prefix": true, + }, + actorRef0: { "@id": "as:actor", "@type": "@id" }, + actorRef1: { "@id": "as:actor", "@type": "@id" }, + targetRef0: { "@id": "as:target", "@type": "@id" }, + targetRef1: { "@id": "as:target", "@type": "@id" }, + objectRef0: { "@id": "as:object", "@type": "@id" }, + objectRef1: { "@id": "as:object", "@type": "@id" }, + }, + ], + }, + }; + } + return await mockDocumentLoader(resource, options); + }; + + const activity = await Activity.fromJsonLd({ + "@context": contextUrl, + type: "Create", + actorRef0: "ap://did:key:z6Mkabc/actor0", + actorRef1: "ap://did:key:z6Mkabc/actor1", + targetRef0: "ap://did:key:z6Mkabc/target0", + targetRef1: "ap://did:key:z6Mkabc/target1", + objectRef0: "https://example.com/objects/0", + objectRef1: "https://example.com/objects/1", + }, { documentLoader: mockDocumentLoader, contextLoader }); + + await activity.toJsonLd({ contextLoader }); + + ok(contextLoads <= 5); +}); + +test("fromJsonLd() falls back when portable IRI cache merge fails", async () => { + const contextUrl = "https://example.com/contexts/failing-cache-merge"; + let contextLoads = 0; + const contextLoader: DocumentLoader = async ( + resource: string, + options, + ): Promise => { + if (resource === contextUrl) { + contextLoads++; + if (contextLoads > 1) throw new Error("merge context unavailable"); + return { + contextUrl: null, + documentUrl: resource, + document: { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + "@vocab": "https://example.com/ns#", + extraRef: { "@type": "@id" }, + }, + ], + }, + }; + } + return await mockDocumentLoader(resource, options); + }; + + const note = await Note.fromJsonLd({ + "@context": contextUrl, + type: "Note", + id: "ap://did:key:z6Mkabc/objects/1", + extraRef: "ap://did:key:z6Mkabc/extra", + }, { documentLoader: mockDocumentLoader, contextLoader }); + + const jsonLd = await note.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + + deepStrictEqual(jsonLd.type, "Note"); + deepStrictEqual(jsonLd.id, "ap+ef61://did:key:z6Mkabc/objects/1"); +}); + test("fromJsonLd() formats portable IRIs in scalar URL values", async () => { const note = await Note.fromJsonLd({ "@context": [ From a887b9910e44a4d0fdaf47364d2d14fce4feb9d7 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 13:08:20 +0900 Subject: [PATCH 26/55] Harden portable IRI cache handling Reject DID authorities whose literal DID path would expose malformed percent escapes after decoding an encoded percent sign. Also avoid mutating compacted JSON-LD objects while preserving unmapped terms, and clone normalized expanded cache data before subtype decoding mutates the working values object. https://github.com/fedify-dev/fedify/pull/850#discussion_r3496026508 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496026527 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496043368 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 1 + packages/vocab-runtime/src/url.ts | 8 +- .../src/__snapshots__/class.test.ts.deno.snap | 245 +++++++++++++++++- .../src/__snapshots__/class.test.ts.node.snap | 245 +++++++++++++++++- .../src/__snapshots__/class.test.ts.snap | 245 +++++++++++++++++- packages/vocab-tools/src/class.ts | 2 +- packages/vocab-tools/src/codec.ts | 3 + packages/vocab/src/vocab.test.ts | 50 ++++ 8 files changed, 794 insertions(+), 5 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 1f4a55e63..92f9db17a 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -80,6 +80,7 @@ test("parseIri() rejects malformed portable DID authorities", () => { "ap://did:key/actor", "ap://did:123:abc/actor", "ap://did%3Akey%3Aabc%25zz/actor", + "ap://did:key:abc%25zz/actor", ]; for (const iri of cases) { ok(!canParseIri(iri)); diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index ae2680786..2400653fc 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -94,7 +94,13 @@ function decodePortableAuthority(authority: string): string { if (INVALID_PERCENT_ENCODING_PATTERN.test(authority)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } - if (DID_SCHEME_PATTERN.test(authority)) return authority; + if (DID_SCHEME_PATTERN.test(authority)) { + const decoded = authority.replace(/%25/gi, "%"); + if (INVALID_PERCENT_ENCODING_PATTERN.test(decoded)) { + throw new TypeError("Invalid portable ActivityPub IRI authority."); + } + return authority; + } const decoded = authority.replace(/%3A/gi, ":").replace(/%25/gi, "%"); if (INVALID_PERCENT_ENCODING_PATTERN.test(decoded)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 29dc539be..6df71d40a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -132,7 +132,7 @@ async function mergeUnmappedJsonLdTerms( ) { return compacted; } - const result = compacted as Record; + const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => key !== \\"@context\\" && !(key in result) ); @@ -11022,6 +11022,9 @@ get urls(): ((URL | Link))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -13376,6 +13379,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -14429,6 +14435,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -17733,6 +17742,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -18455,6 +18467,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -18998,6 +19013,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -19624,6 +19642,9 @@ unit?: string | null;numericalValue?: Decimal | null;} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -20670,6 +20691,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -21146,6 +21170,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -21777,6 +21804,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -22565,6 +22595,9 @@ get manualApprovals(): (URL)[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -23622,6 +23655,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -24097,6 +24133,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -25056,6 +25095,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -25531,6 +25573,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -26489,6 +26534,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -26964,6 +27012,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -27453,6 +27504,9 @@ get endpoints(): (URL)[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -27820,6 +27874,9 @@ endpoints?: (URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -28678,6 +28735,9 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -29691,6 +29751,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -30617,6 +30680,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -31273,6 +31339,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -31892,6 +31961,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -32735,6 +32807,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -33625,6 +33700,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -34155,6 +34233,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -34524,6 +34605,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -34892,6 +34976,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -40625,6 +40712,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -42094,6 +42184,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -42462,6 +42555,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -43510,6 +43606,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -44194,6 +44293,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -44640,6 +44742,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -45011,6 +45116,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -45380,6 +45488,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -49356,6 +49467,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -51253,6 +51367,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -51768,6 +51885,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -52135,6 +52255,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -52500,6 +52623,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -53334,6 +53460,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -53942,6 +54071,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -54310,6 +54442,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -54679,6 +54814,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -60412,6 +60550,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -62861,6 +63002,9 @@ get names(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -63551,6 +63695,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -63921,6 +64068,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -64293,6 +64443,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -64660,6 +64813,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -65027,6 +65183,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -65394,6 +65553,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -65761,6 +65923,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -66126,6 +66291,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -66457,6 +66625,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -66825,6 +66996,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -67875,6 +68049,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -68709,6 +68886,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -69536,6 +69716,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -75369,6 +75552,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -76828,6 +77014,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -82561,6 +82750,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -84476,6 +84668,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -85376,6 +85571,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -87105,6 +87303,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -87810,6 +88011,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -88181,6 +88385,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -89761,6 +89968,9 @@ relationships?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -90290,6 +90500,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -96023,6 +96236,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -97698,6 +97914,9 @@ get contents(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -98163,6 +98382,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -98530,6 +98752,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -99113,6 +99338,9 @@ get formerTypes(): (\$EntityType)[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -99581,6 +99809,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -99953,6 +100184,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -100323,6 +100557,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -100693,6 +100930,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -101059,6 +101299,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 5586f7cdd..8c6abb9e4 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -130,7 +130,7 @@ async function mergeUnmappedJsonLdTerms( ) { return compacted; } - const result = compacted as Record; + const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => key !== \\"@context\\" && !(key in result) ); @@ -11020,6 +11020,9 @@ get urls(): ((URL | Link))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -13374,6 +13377,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -14427,6 +14433,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -17731,6 +17740,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -18453,6 +18465,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -18996,6 +19011,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -19622,6 +19640,9 @@ unit?: string | null;numericalValue?: Decimal | null;} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -20668,6 +20689,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -21144,6 +21168,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -21775,6 +21802,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -22563,6 +22593,9 @@ get manualApprovals(): (URL)[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -23620,6 +23653,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -24095,6 +24131,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -25054,6 +25093,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -25529,6 +25571,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -26487,6 +26532,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -26962,6 +27010,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -27451,6 +27502,9 @@ get endpoints(): (URL)[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -27818,6 +27872,9 @@ endpoints?: (URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -28676,6 +28733,9 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -29689,6 +29749,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -30615,6 +30678,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -31271,6 +31337,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -31890,6 +31959,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -32733,6 +32805,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -33623,6 +33698,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -34153,6 +34231,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -34522,6 +34603,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -34890,6 +34974,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -40623,6 +40710,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -42092,6 +42182,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -42460,6 +42553,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -43508,6 +43604,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -44192,6 +44291,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -44638,6 +44740,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -45009,6 +45114,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -45378,6 +45486,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -49354,6 +49465,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -51251,6 +51365,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -51766,6 +51883,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -52133,6 +52253,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -52498,6 +52621,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -53332,6 +53458,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -53940,6 +54069,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -54308,6 +54440,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -54677,6 +54812,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -60410,6 +60548,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -62859,6 +63000,9 @@ get names(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -63549,6 +63693,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -63919,6 +64066,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -64291,6 +64441,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -64658,6 +64811,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -65025,6 +65181,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -65392,6 +65551,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -65759,6 +65921,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -66124,6 +66289,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -66455,6 +66623,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -66823,6 +66994,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -67873,6 +68047,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -68707,6 +68884,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -69534,6 +69714,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -75367,6 +75550,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -76826,6 +77012,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -82559,6 +82748,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -84474,6 +84666,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -85374,6 +85569,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -87103,6 +87301,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -87808,6 +88009,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -88179,6 +88383,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -89759,6 +89966,9 @@ relationships?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -90288,6 +90498,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -96021,6 +96234,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -97696,6 +97912,9 @@ get contents(): ((string | LanguageString))[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, @@ -98161,6 +98380,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -98528,6 +98750,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -99111,6 +99336,9 @@ get formerTypes(): ($EntityType)[] { const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -99579,6 +99807,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -99951,6 +100182,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -100321,6 +100555,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -100691,6 +100928,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { @@ -101057,6 +101297,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values[\\"@type\\"]; const instance = await super.fromJsonLd(values, { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 7647cbed4..fb3bb7a3a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -132,7 +132,7 @@ async function mergeUnmappedJsonLdTerms( ) { return compacted; } - const result = compacted as Record; + const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => key !== "@context" && !(key in result) ); @@ -11022,6 +11022,9 @@ get urls(): ((URL | Link))[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -13376,6 +13379,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -14429,6 +14435,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -17733,6 +17742,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -18455,6 +18467,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -18998,6 +19013,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -19624,6 +19642,9 @@ unit?: string | null;numericalValue?: Decimal | null;} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -20670,6 +20691,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -21146,6 +21170,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -21777,6 +21804,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -22565,6 +22595,9 @@ get manualApprovals(): (URL)[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -23622,6 +23655,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -24097,6 +24133,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -25056,6 +25095,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -25531,6 +25573,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -26489,6 +26534,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -26964,6 +27012,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -27453,6 +27504,9 @@ get endpoints(): (URL)[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -27820,6 +27874,9 @@ endpoints?: (URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -28678,6 +28735,9 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -29691,6 +29751,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -30617,6 +30680,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -31273,6 +31339,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -31892,6 +31961,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -32735,6 +32807,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -33625,6 +33700,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -34155,6 +34233,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -34524,6 +34605,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -34892,6 +34976,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -40625,6 +40712,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -42094,6 +42184,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -42462,6 +42555,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -43510,6 +43606,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -44194,6 +44293,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -44640,6 +44742,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -45011,6 +45116,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -45380,6 +45488,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -49356,6 +49467,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -51253,6 +51367,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -51768,6 +51885,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -52135,6 +52255,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -52500,6 +52623,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -53334,6 +53460,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -53942,6 +54071,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -54310,6 +54442,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -54679,6 +54814,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -60412,6 +60550,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -62861,6 +63002,9 @@ get names(): ((string | LanguageString))[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -63551,6 +63695,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -63921,6 +64068,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -64293,6 +64443,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -64660,6 +64813,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -65027,6 +65183,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -65394,6 +65553,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -65761,6 +65923,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -66126,6 +66291,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -66457,6 +66625,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -66825,6 +66996,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -67875,6 +68049,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -68709,6 +68886,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -69536,6 +69716,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -75369,6 +75552,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -76828,6 +77014,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -82561,6 +82750,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -84476,6 +84668,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -85376,6 +85571,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -87105,6 +87303,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -87810,6 +88011,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -88181,6 +88385,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -89761,6 +89968,9 @@ relationships?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -90290,6 +90500,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -96023,6 +96236,9 @@ get preferredUsernames(): ((string | LanguageString))[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -97698,6 +97914,9 @@ get contents(): ((string | LanguageString))[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } const instance = new this( { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, @@ -98163,6 +98382,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -98530,6 +98752,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -99113,6 +99338,9 @@ get formerTypes(): ($EntityType)[] { const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -99581,6 +99809,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -99953,6 +100184,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -100323,6 +100557,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -100693,6 +100930,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { @@ -101059,6 +101299,9 @@ instruments?: (Object | URL)[];} const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } delete values["@type"]; const instance = await super.fromJsonLd(values, { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 64d921cd5..b83461202 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -349,7 +349,7 @@ export async function* generateClasses( ) { return compacted; } - const result = compacted as Record; + const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => key !== "@context" && !(key in result) ); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index ba24e4e9b..e8860f7cc 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -438,6 +438,9 @@ export async function* generateDecoder( const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; + if (cacheJsonLd?.changed) { + cacheJsonLd.value = structuredClone(cacheJsonLd.value); + } `; if (type.extends == null) { yield ` diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 656e43bf6..56cec0ed5 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -707,6 +707,56 @@ test("fromJsonLd() preserves expanded arrays with portable IRIs", async () => { ]); }); +test("fromJsonLd() preserves expanded subtype cache types", async () => { + const expanded = [ + { + "@id": "https://example.com/activities/1", + "@type": ["https://www.w3.org/ns/activitystreams#Create"], + "https://www.w3.org/ns/activitystreams#actor": [ + { "@id": "https://example.com/actors/alice" }, + ], + "https://www.w3.org/ns/activitystreams#object": [ + { "@id": "https://example.com/objects/1" }, + ], + }, + { + "@id": "https://example.com/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attributedTo": [ + { "@id": "ap://did:key:z6Mkabc/actor" }, + ], + }, + ]; + + const activity = await Activity.fromJsonLd(expanded, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await activity.toJsonLd(), [ + { + "@id": "https://example.com/activities/1", + "@type": ["https://www.w3.org/ns/activitystreams#Create"], + "https://www.w3.org/ns/activitystreams#actor": [ + { "@id": "https://example.com/actors/alice" }, + ], + "https://www.w3.org/ns/activitystreams#object": [ + { "@id": "https://example.com/objects/1" }, + ], + }, + { + "@id": "https://example.com/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attributedTo": [ + { "@id": "ap+ef61://did:key:z6Mkabc/actor" }, + ], + }, + ]); + deepStrictEqual(expanded[0]["@type"], [ + "https://www.w3.org/ns/activitystreams#Create", + ]); +}); + test("fromJsonLd() formats portable IRIs in JSON-LD containers", async () => { const note = await Note.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", From 52679228225752bd65491ed653ea01f28144d677 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 13:26:18 +0900 Subject: [PATCH 27/55] Preserve portable IRI cache contexts Normalize at:// string bases before resolving relative IRIs, so raw DID colons do not make standard URL construction reject a valid base. Also keep single-element compact JSON-LD array cache entries compact by reading the element-level context and wrapping the compacted cache back in an array. https://github.com/fedify-dev/fedify/pull/850#discussion_r3496108569 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496122120 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 12 + packages/vocab-runtime/src/url.ts | 3 +- .../src/__snapshots__/class.test.ts.deno.snap | 1053 ++++++++++------- .../src/__snapshots__/class.test.ts.node.snap | 1053 ++++++++++------- .../src/__snapshots__/class.test.ts.snap | 1053 ++++++++++------- packages/vocab-tools/src/codec.ts | 13 +- packages/vocab/src/vocab.test.ts | 17 + 7 files changed, 1983 insertions(+), 1221 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 92f9db17a..7f929e074 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -66,6 +66,18 @@ test("parseIri() resolves relative IRIs against portable string bases", () => { ); }); +test("parseIri() resolves relative IRIs against at:// string bases", () => { + ok(canParseIri("/record", "at://did:plc:example/collection/item")); + deepStrictEqual( + parseIri("/record", "at://did:plc:example/collection/item"), + new URL("at://did%3Aplc%3Aexample/record"), + ); + deepStrictEqual( + parseIri("reply", "at://did:plc:example/collection/item"), + new URL("at://did%3Aplc%3Aexample/collection/reply"), + ); +}); + test("parseIri() rejects portable IRIs without paths", () => { ok(!canParseIri("ap://did:key:z6Mkabc")); ok( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 2400653fc..84456811a 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -87,7 +87,8 @@ function normalizePortableUrl(iri: URL): URL | null { function normalizeBaseIri(base?: string | URL): string | URL | undefined { if (base == null) return undefined; if (base instanceof URL) return normalizePortableUrl(base) ?? base; - return parsePortableIri(base) ?? base; + return parsePortableIri(base) ?? + (base.startsWith("at://") ? parseAtUri(base) : base); } function decodePortableAuthority(authority: string): string { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 6df71d40a..a6f2dc53c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -12164,12 +12164,14 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -12181,10 +12183,11 @@ get urls(): ((URL | Link))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13396,12 +13399,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -13413,10 +13418,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14538,12 +14544,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -14555,10 +14563,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17959,12 +17968,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -17976,10 +17987,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18484,12 +18496,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -18501,10 +18515,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19073,12 +19088,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -19090,10 +19107,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19690,12 +19708,14 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -19707,10 +19727,11 @@ unit?: string | null;numericalValue?: Decimal | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20768,12 +20789,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -20785,10 +20808,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21187,12 +21211,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -21204,10 +21230,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21900,12 +21927,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -21917,10 +21946,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22643,12 +22673,14 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -22660,10 +22692,11 @@ get manualApprovals(): (URL)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23732,12 +23765,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -23749,10 +23784,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24150,12 +24186,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -24167,10 +24205,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25172,12 +25211,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -25189,10 +25230,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25590,12 +25632,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -25607,10 +25651,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26611,12 +26656,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -26628,10 +26675,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27029,12 +27077,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27046,10 +27096,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27534,12 +27585,14 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27551,10 +27604,11 @@ get endpoints(): (URL)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27891,12 +27945,14 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27908,10 +27964,11 @@ endpoints?: (URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28853,12 +28910,14 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -28870,10 +28929,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29831,12 +29891,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -29848,10 +29910,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30760,12 +30823,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -30777,10 +30842,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31398,12 +31464,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -31415,10 +31483,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32012,12 +32081,14 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -32029,10 +32100,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32918,12 +32990,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -32935,10 +33009,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33795,12 +33870,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -33812,10 +33889,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34250,12 +34328,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -34267,10 +34347,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34622,12 +34703,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -34639,10 +34722,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34993,12 +35077,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -35010,10 +35096,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41346,12 +41433,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -41363,10 +41452,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42201,12 +42291,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -42218,10 +42310,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42572,12 +42665,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -42589,10 +42684,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43709,12 +43805,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -43726,10 +43824,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44346,12 +44445,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -44363,10 +44464,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44759,12 +44861,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -44776,10 +44880,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45133,12 +45238,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -45150,10 +45257,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45505,12 +45613,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -45522,10 +45632,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -49872,12 +49983,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -49889,10 +50002,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51474,12 +51588,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -51491,10 +51607,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51902,12 +52019,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -51919,10 +52038,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52272,12 +52392,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -52289,10 +52411,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52640,12 +52763,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -52657,10 +52782,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53580,12 +53706,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -53597,10 +53725,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54088,12 +54217,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54105,10 +54236,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54459,12 +54591,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54476,10 +54610,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54831,12 +54966,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54848,10 +54985,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -61184,12 +61322,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -61201,10 +61341,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63186,12 +63327,14 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -63203,10 +63346,11 @@ get names(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63712,12 +63856,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -63729,10 +63875,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64085,12 +64232,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64102,10 +64251,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64460,12 +64610,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64477,10 +64629,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64830,12 +64983,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64847,10 +65002,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65200,12 +65356,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65217,10 +65375,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65570,12 +65729,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65587,10 +65748,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65940,12 +66102,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65957,10 +66121,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66308,12 +66473,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -66325,10 +66492,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66642,12 +66810,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -66659,10 +66829,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67013,12 +67184,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -67030,10 +67203,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68152,12 +68326,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -68169,10 +68345,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68943,12 +69120,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -68960,10 +69139,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69791,12 +69971,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -69808,10 +69990,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76186,12 +76369,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -76203,10 +76388,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -77031,12 +77217,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -77048,10 +77236,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -83384,12 +83573,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -83401,10 +83592,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -84799,12 +84991,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -84816,10 +85010,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85618,12 +85813,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -85635,10 +85832,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87515,12 +87713,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -87532,10 +87732,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88028,12 +88229,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -88045,10 +88248,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88402,12 +88606,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -88419,10 +88625,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90075,12 +90282,14 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -90092,10 +90301,11 @@ relationships?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90517,12 +90727,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -90534,10 +90746,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -96870,12 +97083,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -96887,10 +97102,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97968,12 +98184,14 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -97985,10 +98203,11 @@ get contents(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98399,12 +98618,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -98416,10 +98637,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98769,12 +98991,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -98786,10 +99010,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99408,12 +99633,14 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -99425,10 +99652,11 @@ get formerTypes(): (\$EntityType)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99826,12 +100054,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -99843,10 +100073,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100201,12 +100432,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100218,10 +100451,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100574,12 +100808,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100591,10 +100827,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100947,12 +101184,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100964,10 +101203,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101316,12 +101556,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -101333,10 +101575,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 8c6abb9e4..a3df47890 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -12162,12 +12162,14 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -12179,10 +12181,11 @@ get urls(): ((URL | Link))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13394,12 +13397,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -13411,10 +13416,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14536,12 +14542,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -14553,10 +14561,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17957,12 +17966,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -17974,10 +17985,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18482,12 +18494,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -18499,10 +18513,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19071,12 +19086,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -19088,10 +19105,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19688,12 +19706,14 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -19705,10 +19725,11 @@ unit?: string | null;numericalValue?: Decimal | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20766,12 +20787,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -20783,10 +20806,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21185,12 +21209,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -21202,10 +21228,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21898,12 +21925,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -21915,10 +21944,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22641,12 +22671,14 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -22658,10 +22690,11 @@ get manualApprovals(): (URL)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23730,12 +23763,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -23747,10 +23782,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24148,12 +24184,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -24165,10 +24203,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25170,12 +25209,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -25187,10 +25228,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25588,12 +25630,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -25605,10 +25649,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26609,12 +26654,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -26626,10 +26673,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27027,12 +27075,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27044,10 +27094,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27532,12 +27583,14 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27549,10 +27602,11 @@ get endpoints(): (URL)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27889,12 +27943,14 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27906,10 +27962,11 @@ endpoints?: (URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28851,12 +28908,14 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -28868,10 +28927,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29829,12 +29889,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -29846,10 +29908,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30758,12 +30821,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -30775,10 +30840,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31396,12 +31462,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -31413,10 +31481,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32010,12 +32079,14 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -32027,10 +32098,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32916,12 +32988,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -32933,10 +33007,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33793,12 +33868,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -33810,10 +33887,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34248,12 +34326,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -34265,10 +34345,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34620,12 +34701,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -34637,10 +34720,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34991,12 +35075,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -35008,10 +35094,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41344,12 +41431,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -41361,10 +41450,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42199,12 +42289,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -42216,10 +42308,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42570,12 +42663,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -42587,10 +42682,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43707,12 +43803,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -43724,10 +43822,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44344,12 +44443,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -44361,10 +44462,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44757,12 +44859,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -44774,10 +44878,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45131,12 +45236,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -45148,10 +45255,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45503,12 +45611,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -45520,10 +45630,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -49870,12 +49981,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -49887,10 +50000,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51472,12 +51586,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -51489,10 +51605,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51900,12 +52017,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -51917,10 +52036,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52270,12 +52390,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -52287,10 +52409,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52638,12 +52761,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -52655,10 +52780,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53578,12 +53704,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -53595,10 +53723,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54086,12 +54215,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54103,10 +54234,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54457,12 +54589,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54474,10 +54608,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54829,12 +54964,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54846,10 +54983,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -61182,12 +61320,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -61199,10 +61339,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63184,12 +63325,14 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -63201,10 +63344,11 @@ get names(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63710,12 +63854,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -63727,10 +63873,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64083,12 +64230,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64100,10 +64249,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64458,12 +64608,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64475,10 +64627,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64828,12 +64981,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64845,10 +65000,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65198,12 +65354,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65215,10 +65373,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65568,12 +65727,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65585,10 +65746,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65938,12 +66100,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65955,10 +66119,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66306,12 +66471,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -66323,10 +66490,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66640,12 +66808,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -66657,10 +66827,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67011,12 +67182,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -67028,10 +67201,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68150,12 +68324,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -68167,10 +68343,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68941,12 +69118,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -68958,10 +69137,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69789,12 +69969,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -69806,10 +69988,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76184,12 +76367,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -76201,10 +76386,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -77029,12 +77215,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -77046,10 +77234,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -83382,12 +83571,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -83399,10 +83590,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -84797,12 +84989,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -84814,10 +85008,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85616,12 +85811,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -85633,10 +85830,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87513,12 +87711,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -87530,10 +87730,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88026,12 +88227,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -88043,10 +88246,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88400,12 +88604,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -88417,10 +88623,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90073,12 +90280,14 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -90090,10 +90299,11 @@ relationships?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90515,12 +90725,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -90532,10 +90744,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -96868,12 +97081,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -96885,10 +97100,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97966,12 +98182,14 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -97983,10 +98201,11 @@ get contents(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98397,12 +98616,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -98414,10 +98635,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98767,12 +98989,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -98784,10 +99008,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99406,12 +99631,14 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -99423,10 +99650,11 @@ get formerTypes(): ($EntityType)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99824,12 +100052,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -99841,10 +100071,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100199,12 +100430,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100216,10 +100449,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100572,12 +100806,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100589,10 +100825,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100945,12 +101182,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100962,10 +101201,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101314,12 +101554,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === \\"object\\" && - \\"@context\\" in json - ? (json as Record)[\\"@context\\"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === \\"object\\" && + !Array.isArray(jsonLd) && \\"@context\\" in jsonLd + ? (jsonLd as Record)[\\"@context\\"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -101331,10 +101573,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index fb3bb7a3a..0c1b2f091 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -12164,12 +12164,14 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -12181,10 +12183,11 @@ get urls(): ((URL | Link))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13396,12 +13399,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -13413,10 +13418,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14538,12 +14544,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -14555,10 +14563,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17959,12 +17968,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -17976,10 +17987,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18484,12 +18496,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -18501,10 +18515,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19073,12 +19088,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -19090,10 +19107,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19690,12 +19708,14 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -19707,10 +19727,11 @@ unit?: string | null;numericalValue?: Decimal | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20768,12 +20789,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -20785,10 +20808,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21187,12 +21211,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -21204,10 +21230,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21900,12 +21927,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -21917,10 +21946,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22643,12 +22673,14 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -22660,10 +22692,11 @@ get manualApprovals(): (URL)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23732,12 +23765,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -23749,10 +23784,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24150,12 +24186,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -24167,10 +24205,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25172,12 +25211,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -25189,10 +25230,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25590,12 +25632,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -25607,10 +25651,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26611,12 +26656,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -26628,10 +26675,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27029,12 +27077,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27046,10 +27096,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27534,12 +27585,14 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27551,10 +27604,11 @@ get endpoints(): (URL)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27891,12 +27945,14 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -27908,10 +27964,11 @@ endpoints?: (URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28853,12 +28910,14 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -28870,10 +28929,11 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29831,12 +29891,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -29848,10 +29910,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30760,12 +30823,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -30777,10 +30842,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31398,12 +31464,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -31415,10 +31483,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32012,12 +32081,14 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -32029,10 +32100,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32918,12 +32990,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -32935,10 +33009,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33795,12 +33870,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -33812,10 +33889,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34250,12 +34328,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -34267,10 +34347,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34622,12 +34703,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -34639,10 +34722,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34993,12 +35077,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -35010,10 +35096,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41346,12 +41433,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -41363,10 +41452,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42201,12 +42291,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -42218,10 +42310,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42572,12 +42665,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -42589,10 +42684,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43709,12 +43805,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -43726,10 +43824,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44346,12 +44445,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -44363,10 +44464,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44759,12 +44861,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -44776,10 +44880,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45133,12 +45238,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -45150,10 +45257,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45505,12 +45613,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -45522,10 +45632,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -49872,12 +49983,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -49889,10 +50002,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51474,12 +51588,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -51491,10 +51607,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51902,12 +52019,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -51919,10 +52038,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52272,12 +52392,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -52289,10 +52411,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52640,12 +52763,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -52657,10 +52782,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53580,12 +53706,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -53597,10 +53725,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54088,12 +54217,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54105,10 +54236,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54459,12 +54591,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54476,10 +54610,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54831,12 +54966,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -54848,10 +54985,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -61184,12 +61322,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -61201,10 +61341,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63186,12 +63327,14 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -63203,10 +63346,11 @@ get names(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63712,12 +63856,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -63729,10 +63875,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64085,12 +64232,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64102,10 +64251,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64460,12 +64610,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64477,10 +64629,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64830,12 +64983,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -64847,10 +65002,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65200,12 +65356,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65217,10 +65375,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65570,12 +65729,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65587,10 +65748,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65940,12 +66102,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -65957,10 +66121,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66308,12 +66473,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -66325,10 +66492,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66642,12 +66810,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -66659,10 +66829,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67013,12 +67184,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -67030,10 +67203,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68152,12 +68326,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -68169,10 +68345,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68943,12 +69120,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -68960,10 +69139,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69791,12 +69971,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -69808,10 +69990,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76186,12 +76369,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -76203,10 +76388,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -77031,12 +77217,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -77048,10 +77236,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -83384,12 +83573,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -83401,10 +83592,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -84799,12 +84991,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -84816,10 +85010,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85618,12 +85813,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -85635,10 +85832,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87515,12 +87713,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -87532,10 +87732,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88028,12 +88229,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -88045,10 +88248,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88402,12 +88606,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -88419,10 +88625,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90075,12 +90282,14 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -90092,10 +90301,11 @@ relationships?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90517,12 +90727,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -90534,10 +90746,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -96870,12 +97083,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -96887,10 +97102,11 @@ get preferredUsernames(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97968,12 +98184,14 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -97985,10 +98203,11 @@ get contents(): ((string | LanguageString))[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98399,12 +98618,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -98416,10 +98637,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98769,12 +98991,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -98786,10 +99010,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99408,12 +99633,14 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -99425,10 +99652,11 @@ get formerTypes(): ($EntityType)[] { documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99826,12 +100054,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -99843,10 +100073,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100201,12 +100432,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100218,10 +100451,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100574,12 +100808,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100591,10 +100827,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100947,12 +101184,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -100964,10 +101203,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101316,12 +101556,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -101333,10 +101575,11 @@ instruments?: (Object | URL)[];} documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index e8860f7cc..c3c269f0c 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -546,12 +546,14 @@ export async function* generateDecoder( if (!("_fromSubclass" in options) || !options._fromSubclass) { try { if (cacheJsonLd?.changed) { - const context = json != null && typeof json === "object" && - "@context" in json - ? (json as Record)["@context"] + const compactArray = Array.isArray(json) && json.length === 1; + const jsonLd = compactArray ? json[0] : json; + const context = jsonLd != null && typeof jsonLd === "object" && + !Array.isArray(jsonLd) && "@context" in jsonLd + ? (jsonLd as Record)["@context"] : undefined; const normalized = cacheJsonLd.value; - instance._cachedJsonLd = context == null + const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( await jsonld.compact( @@ -563,10 +565,11 @@ export async function* generateDecoder( documentLoader: options.contextLoader, }, ), - json, + jsonLd, context, options.contextLoader, ); + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 56cec0ed5..606ce4802 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -757,6 +757,23 @@ test("fromJsonLd() preserves expanded subtype cache types", async () => { ]); }); +test("fromJsonLd() preserves compact array contexts with portable IRIs", async () => { + const note = await Note.fromJsonLd([{ + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: "ap://did:key:z6Mkabc/objects/1", + }], { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await note.toJsonLd(), [{ + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: "ap+ef61://did:key:z6Mkabc/objects/1", + }]); +}); + test("fromJsonLd() formats portable IRIs in JSON-LD containers", async () => { const note = await Note.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", From 8fbb58fea7fb52ad6c0182c199a0bb5677611ae6 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 13:42:42 +0900 Subject: [PATCH 28/55] Avoid redundant portable IRI cache objects Return the original JSON-LD subtree reference from generated portable IRI normalization when no values change, so the decoder can detect cache rewrites by reference instead of allocating wrapper objects at every recursive step. Also leave encoded at:// bases on the standard URL path during relative IRI resolution, avoiding double-encoding of already URL-safe DID authorities. https://github.com/fedify-dev/fedify/pull/850#discussion_r3496163429 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496163431 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496163433 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496181766 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 4 + packages/vocab-runtime/src/url.ts | 4 +- .../src/__snapshots__/class.test.ts.deno.snap | 833 +++++++++--------- .../src/__snapshots__/class.test.ts.node.snap | 833 +++++++++--------- .../src/__snapshots__/class.test.ts.snap | 833 +++++++++--------- packages/vocab-tools/src/class.ts | 23 +- packages/vocab-tools/src/codec.ts | 10 +- 7 files changed, 1271 insertions(+), 1269 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 7f929e074..d639b3513 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -76,6 +76,10 @@ test("parseIri() resolves relative IRIs against at:// string bases", () => { parseIri("reply", "at://did:plc:example/collection/item"), new URL("at://did%3Aplc%3Aexample/collection/reply"), ); + deepStrictEqual( + parseIri("reply", "at://did%3Aplc%3Aexample/collection/item"), + new URL("at://did%3Aplc%3Aexample/collection/reply"), + ); }); test("parseIri() rejects portable IRIs without paths", () => { diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 84456811a..058a2d3db 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -88,7 +88,9 @@ function normalizeBaseIri(base?: string | URL): string | URL | undefined { if (base == null) return undefined; if (base instanceof URL) return normalizePortableUrl(base) ?? base; return parsePortableIri(base) ?? - (base.startsWith("at://") ? parseAtUri(base) : base); + (base.startsWith("at://") && !URL.canParse(".", base) + ? parseAtUri(base) + : base); } function decodePortableAuthority(authority: string): string { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index a6f2dc53c..cbada2583 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -50,18 +50,17 @@ function normalizePortableIris( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): { value: unknown; changed: boolean } { - if (depth > 32 || key === \\"@context\\") return { value, changed: false }; +): unknown { + if (depth > 32 || key === \\"@context\\") return value; if (typeof value === \\"string\\") { if ( key != null && isPortableIriValuePosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ) { - const normalized = formatIri(value); - return { value: normalized, changed: normalized !== value }; + return formatIri(value); } - return { value, changed: false }; + return value; } if (Array.isArray(value)) { let clone: unknown[] | undefined; @@ -73,17 +72,17 @@ function normalizePortableIris( parentKey, portableIriKeys, ); - if (result.changed) { + if (result !== value[i]) { clone ??= value.slice(0, i); - clone.push(result.value); + clone.push(result); } else if (clone != null) { clone.push(value[i]); } } - return { value: clone ?? value, changed: clone != null }; + return clone ?? value; } if (value == null || typeof value !== \\"object\\") { - return { value, changed: false }; + return value; } const object = value as Record; let clone: Record | undefined; @@ -95,12 +94,12 @@ function normalizePortableIris( key, portableIriKeys, ); - if (result.changed) { + if (result !== object[entryKey]) { clone ??= { ...object }; - clone[entryKey] = result.value; + clone[entryKey] = result; } } - return { value: clone ?? object, changed: clone != null }; + return clone ?? object; } function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { @@ -11019,11 +11018,11 @@ get urls(): ((URL | Link))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -12163,14 +12162,14 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -13379,11 +13378,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -13398,14 +13397,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -14438,11 +14437,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -14543,14 +14542,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -17748,11 +17747,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -17967,14 +17966,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -18476,11 +18475,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -18495,14 +18494,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -19025,11 +19024,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -19087,14 +19086,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -19657,11 +19656,11 @@ unit?: string | null;numericalValue?: Decimal | null;} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -19707,14 +19706,14 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -20709,11 +20708,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -20788,14 +20787,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -21191,11 +21190,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -21210,14 +21209,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -21828,11 +21827,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -21926,14 +21925,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -22622,11 +22621,11 @@ get manualApprovals(): (URL)[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -22672,14 +22671,14 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -23685,11 +23684,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -23764,14 +23763,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -24166,11 +24165,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -24185,14 +24184,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -25131,11 +25130,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -25210,14 +25209,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -25612,11 +25611,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -25631,14 +25630,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -26576,11 +26575,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -26655,14 +26654,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27057,11 +27056,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -27076,14 +27075,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27552,11 +27551,11 @@ get endpoints(): (URL)[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -27584,14 +27583,14 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27925,11 +27924,11 @@ endpoints?: (URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -27944,14 +27943,14 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -28789,11 +28788,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -28909,14 +28908,14 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -29808,11 +29807,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -29890,14 +29889,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -30740,11 +30739,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -30822,14 +30821,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -31402,11 +31401,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -31463,14 +31462,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -32027,11 +32026,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -32080,14 +32079,14 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -32876,11 +32875,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -32989,14 +32988,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -33772,11 +33771,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -33869,14 +33868,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -34308,11 +34307,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -34327,14 +34326,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -34683,11 +34682,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -34702,14 +34701,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -35057,11 +35056,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -35076,14 +35075,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -40796,11 +40795,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -41432,14 +41431,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -42271,11 +42270,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -42290,14 +42289,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -42645,11 +42644,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -42664,14 +42663,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -43699,11 +43698,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -43804,14 +43803,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -44389,11 +44388,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -44444,14 +44443,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -44841,11 +44840,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -44860,14 +44859,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -45218,11 +45217,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -45237,14 +45236,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -45593,11 +45592,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -45612,14 +45611,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -49575,11 +49574,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -49982,14 +49981,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -51478,11 +51477,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -51587,14 +51586,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -51999,11 +51998,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -52018,14 +52017,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -52372,11 +52371,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -52391,14 +52390,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -52743,11 +52742,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -52762,14 +52761,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -53583,11 +53582,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -53705,14 +53704,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54197,11 +54196,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -54216,14 +54215,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54571,11 +54570,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -54590,14 +54589,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54946,11 +54945,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -54965,14 +54964,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -60685,11 +60684,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -61321,14 +61320,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -63140,11 +63139,11 @@ get names(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -63326,14 +63325,14 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -63836,11 +63835,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -63855,14 +63854,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64212,11 +64211,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -64231,14 +64230,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64590,11 +64589,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -64609,14 +64608,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64963,11 +64962,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -64982,14 +64981,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -65336,11 +65335,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -65355,14 +65354,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -65709,11 +65708,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -65728,14 +65727,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66082,11 +66081,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -66101,14 +66100,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66453,11 +66452,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -66472,14 +66471,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66790,11 +66789,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -66809,14 +66808,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -67164,11 +67163,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -67183,14 +67182,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -68220,11 +68219,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -68325,14 +68324,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -69060,11 +69059,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -69119,14 +69118,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -69893,11 +69892,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -69970,14 +69969,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -75732,11 +75731,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -76368,14 +76367,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -77197,11 +77196,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -77216,14 +77215,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -82936,11 +82935,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -83572,14 +83571,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -84857,11 +84856,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -84990,14 +84989,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -85763,11 +85762,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -85812,14 +85811,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -87498,11 +87497,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -87712,14 +87711,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -88209,11 +88208,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -88228,14 +88227,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -88586,11 +88585,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -88605,14 +88604,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -90172,11 +90171,11 @@ relationships?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -90281,14 +90280,14 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -90707,11 +90706,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -90726,14 +90725,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -96446,11 +96445,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -97082,14 +97081,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98127,11 +98126,11 @@ get contents(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -98183,14 +98182,14 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98598,11 +98597,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -98617,14 +98616,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98971,11 +98970,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -98990,14 +98989,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -99560,11 +99559,11 @@ get formerTypes(): (\$EntityType)[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -99632,14 +99631,14 @@ get formerTypes(): (\$EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100034,11 +100033,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -100053,14 +100052,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100412,11 +100411,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -100431,14 +100430,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100788,11 +100787,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -100807,14 +100806,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -101164,11 +101163,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -101183,14 +101182,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -101536,11 +101535,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -101555,14 +101554,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index a3df47890..a14179f20 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -48,18 +48,17 @@ function normalizePortableIris( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): { value: unknown; changed: boolean } { - if (depth > 32 || key === \\"@context\\") return { value, changed: false }; +): unknown { + if (depth > 32 || key === \\"@context\\") return value; if (typeof value === \\"string\\") { if ( key != null && isPortableIriValuePosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ) { - const normalized = formatIri(value); - return { value: normalized, changed: normalized !== value }; + return formatIri(value); } - return { value, changed: false }; + return value; } if (Array.isArray(value)) { let clone: unknown[] | undefined; @@ -71,17 +70,17 @@ function normalizePortableIris( parentKey, portableIriKeys, ); - if (result.changed) { + if (result !== value[i]) { clone ??= value.slice(0, i); - clone.push(result.value); + clone.push(result); } else if (clone != null) { clone.push(value[i]); } } - return { value: clone ?? value, changed: clone != null }; + return clone ?? value; } if (value == null || typeof value !== \\"object\\") { - return { value, changed: false }; + return value; } const object = value as Record; let clone: Record | undefined; @@ -93,12 +92,12 @@ function normalizePortableIris( key, portableIriKeys, ); - if (result.changed) { + if (result !== object[entryKey]) { clone ??= { ...object }; - clone[entryKey] = result.value; + clone[entryKey] = result; } } - return { value: clone ?? object, changed: clone != null }; + return clone ?? object; } function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { @@ -11017,11 +11016,11 @@ get urls(): ((URL | Link))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -12161,14 +12160,14 @@ get urls(): ((URL | Link))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -13377,11 +13376,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -13396,14 +13395,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -14436,11 +14435,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -14541,14 +14540,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -17746,11 +17745,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -17965,14 +17964,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -18474,11 +18473,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -18493,14 +18492,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -19023,11 +19022,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -19085,14 +19084,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -19655,11 +19654,11 @@ unit?: string | null;numericalValue?: Decimal | null;} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -19705,14 +19704,14 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -20707,11 +20706,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -20786,14 +20785,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -21189,11 +21188,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -21208,14 +21207,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -21826,11 +21825,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -21924,14 +21923,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -22620,11 +22619,11 @@ get manualApprovals(): (URL)[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -22670,14 +22669,14 @@ get manualApprovals(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -23683,11 +23682,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -23762,14 +23761,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -24164,11 +24163,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -24183,14 +24182,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -25129,11 +25128,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -25208,14 +25207,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -25610,11 +25609,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -25629,14 +25628,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -26574,11 +26573,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -26653,14 +26652,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27055,11 +27054,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -27074,14 +27073,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27550,11 +27549,11 @@ get endpoints(): (URL)[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -27582,14 +27581,14 @@ get endpoints(): (URL)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27923,11 +27922,11 @@ endpoints?: (URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -27942,14 +27941,14 @@ endpoints?: (URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -28787,11 +28786,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -28907,14 +28906,14 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -29806,11 +29805,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -29888,14 +29887,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -30738,11 +30737,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -30820,14 +30819,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -31400,11 +31399,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -31461,14 +31460,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -32025,11 +32024,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -32078,14 +32077,14 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -32874,11 +32873,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -32987,14 +32986,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -33770,11 +33769,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -33867,14 +33866,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -34306,11 +34305,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -34325,14 +34324,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -34681,11 +34680,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -34700,14 +34699,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -35055,11 +35054,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -35074,14 +35073,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -40794,11 +40793,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -41430,14 +41429,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -42269,11 +42268,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -42288,14 +42287,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -42643,11 +42642,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -42662,14 +42661,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -43697,11 +43696,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -43802,14 +43801,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -44387,11 +44386,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -44442,14 +44441,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -44839,11 +44838,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -44858,14 +44857,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -45216,11 +45215,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -45235,14 +45234,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -45591,11 +45590,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -45610,14 +45609,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -49573,11 +49572,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -49980,14 +49979,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -51476,11 +51475,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -51585,14 +51584,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -51997,11 +51996,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -52016,14 +52015,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -52370,11 +52369,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -52389,14 +52388,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -52741,11 +52740,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -52760,14 +52759,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -53581,11 +53580,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -53703,14 +53702,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54195,11 +54194,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -54214,14 +54213,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54569,11 +54568,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -54588,14 +54587,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54944,11 +54943,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -54963,14 +54962,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -60683,11 +60682,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -61319,14 +61318,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -63138,11 +63137,11 @@ get names(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -63324,14 +63323,14 @@ get names(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -63834,11 +63833,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -63853,14 +63852,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64210,11 +64209,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -64229,14 +64228,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64588,11 +64587,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -64607,14 +64606,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64961,11 +64960,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -64980,14 +64979,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -65334,11 +65333,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -65353,14 +65352,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -65707,11 +65706,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -65726,14 +65725,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66080,11 +66079,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -66099,14 +66098,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66451,11 +66450,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -66470,14 +66469,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66788,11 +66787,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -66807,14 +66806,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -67162,11 +67161,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -67181,14 +67180,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -68218,11 +68217,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -68323,14 +68322,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -69058,11 +69057,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -69117,14 +69116,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -69891,11 +69890,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -69968,14 +69967,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -75730,11 +75729,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -76366,14 +76365,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -77195,11 +77194,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -77214,14 +77213,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -82934,11 +82933,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -83570,14 +83569,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -84855,11 +84854,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -84988,14 +84987,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -85761,11 +85760,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -85810,14 +85809,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -87496,11 +87495,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -87710,14 +87709,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -88207,11 +88206,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -88226,14 +88225,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -88584,11 +88583,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -88603,14 +88602,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -90170,11 +90169,11 @@ relationships?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -90279,14 +90278,14 @@ relationships?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -90705,11 +90704,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -90724,14 +90723,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -96444,11 +96443,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -97080,14 +97079,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98125,11 +98124,11 @@ get contents(): ((string | LanguageString))[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -98181,14 +98180,14 @@ get contents(): ((string | LanguageString))[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98596,11 +98595,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -98615,14 +98614,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98969,11 +98968,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -98988,14 +98987,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -99558,11 +99557,11 @@ get formerTypes(): ($EntityType)[] { } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -99630,14 +99629,14 @@ get formerTypes(): ($EntityType)[] { if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100032,11 +100031,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -100051,14 +100050,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100410,11 +100409,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -100429,14 +100428,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100786,11 +100785,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -100805,14 +100804,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -101162,11 +101161,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -101181,14 +101180,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -101534,11 +101533,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass + let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values[\\"@type\\"]; @@ -101553,14 +101552,14 @@ instruments?: (Object | URL)[];} if (!(\\"_fromSubclass\\" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === \\"object\\" && !Array.isArray(jsonLd) && \\"@context\\" in jsonLd ? (jsonLd as Record)[\\"@context\\"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 0c1b2f091..d38305d1a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -50,18 +50,17 @@ function normalizePortableIris( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): { value: unknown; changed: boolean } { - if (depth > 32 || key === "@context") return { value, changed: false }; +): unknown { + if (depth > 32 || key === "@context") return value; if (typeof value === "string") { if ( key != null && isPortableIriValuePosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ) { - const normalized = formatIri(value); - return { value: normalized, changed: normalized !== value }; + return formatIri(value); } - return { value, changed: false }; + return value; } if (Array.isArray(value)) { let clone: unknown[] | undefined; @@ -73,17 +72,17 @@ function normalizePortableIris( parentKey, portableIriKeys, ); - if (result.changed) { + if (result !== value[i]) { clone ??= value.slice(0, i); - clone.push(result.value); + clone.push(result); } else if (clone != null) { clone.push(value[i]); } } - return { value: clone ?? value, changed: clone != null }; + return clone ?? value; } if (value == null || typeof value !== "object") { - return { value, changed: false }; + return value; } const object = value as Record; let clone: Record | undefined; @@ -95,12 +94,12 @@ function normalizePortableIris( key, portableIriKeys, ); - if (result.changed) { + if (result !== object[entryKey]) { clone ??= { ...object }; - clone[entryKey] = result.value; + clone[entryKey] = result; } } - return { value: clone ?? object, changed: clone != null }; + return clone ?? object; } function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { @@ -11019,11 +11018,11 @@ get urls(): ((URL | Link))[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -12163,14 +12162,14 @@ get urls(): ((URL | Link))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -13379,11 +13378,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -13398,14 +13397,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -14438,11 +14437,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -14543,14 +14542,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -17748,11 +17747,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -17967,14 +17966,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -18476,11 +18475,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -18495,14 +18494,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -19025,11 +19024,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -19087,14 +19086,14 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -19657,11 +19656,11 @@ unit?: string | null;numericalValue?: Decimal | null;} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -19707,14 +19706,14 @@ unit?: string | null;numericalValue?: Decimal | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -20709,11 +20708,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -20788,14 +20787,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -21191,11 +21190,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -21210,14 +21209,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -21828,11 +21827,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -21926,14 +21925,14 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -22622,11 +22621,11 @@ get manualApprovals(): (URL)[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -22672,14 +22671,14 @@ get manualApprovals(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -23685,11 +23684,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -23764,14 +23763,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -24166,11 +24165,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -24185,14 +24184,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -25131,11 +25130,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -25210,14 +25209,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -25612,11 +25611,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -25631,14 +25630,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -26576,11 +26575,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -26655,14 +26654,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27057,11 +27056,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -27076,14 +27075,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27552,11 +27551,11 @@ get endpoints(): (URL)[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -27584,14 +27583,14 @@ get endpoints(): (URL)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -27925,11 +27924,11 @@ endpoints?: (URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -27944,14 +27943,14 @@ endpoints?: (URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -28789,11 +28788,11 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -28909,14 +28908,14 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -29808,11 +29807,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -29890,14 +29889,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -30740,11 +30739,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -30822,14 +30821,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -31402,11 +31401,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -31463,14 +31462,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -32027,11 +32026,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -32080,14 +32079,14 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -32876,11 +32875,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -32989,14 +32988,14 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -33772,11 +33771,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -33869,14 +33868,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -34308,11 +34307,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -34327,14 +34326,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -34683,11 +34682,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -34702,14 +34701,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -35057,11 +35056,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -35076,14 +35075,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -40796,11 +40795,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -41432,14 +41431,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -42271,11 +42270,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -42290,14 +42289,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -42645,11 +42644,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -42664,14 +42663,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -43699,11 +43698,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -43804,14 +43803,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -44389,11 +44388,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -44444,14 +44443,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -44841,11 +44840,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -44860,14 +44859,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -45218,11 +45217,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -45237,14 +45236,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -45593,11 +45592,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -45612,14 +45611,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -49575,11 +49574,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -49982,14 +49981,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -51478,11 +51477,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -51587,14 +51586,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -51999,11 +51998,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -52018,14 +52017,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -52372,11 +52371,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -52391,14 +52390,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -52743,11 +52742,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -52762,14 +52761,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -53583,11 +53582,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -53705,14 +53704,14 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54197,11 +54196,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -54216,14 +54215,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54571,11 +54570,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -54590,14 +54589,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -54946,11 +54945,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -54965,14 +54964,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -60685,11 +60684,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -61321,14 +61320,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -63140,11 +63139,11 @@ get names(): ((string | LanguageString))[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -63326,14 +63325,14 @@ get names(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -63836,11 +63835,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -63855,14 +63854,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64212,11 +64211,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -64231,14 +64230,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64590,11 +64589,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -64609,14 +64608,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -64963,11 +64962,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -64982,14 +64981,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -65336,11 +65335,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -65355,14 +65354,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -65709,11 +65708,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -65728,14 +65727,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66082,11 +66081,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -66101,14 +66100,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66453,11 +66452,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -66472,14 +66471,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -66790,11 +66789,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -66809,14 +66808,14 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -67164,11 +67163,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -67183,14 +67182,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -68220,11 +68219,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -68325,14 +68324,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -69060,11 +69059,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -69119,14 +69118,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -69893,11 +69892,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -69970,14 +69969,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -75732,11 +75731,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -76368,14 +76367,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -77197,11 +77196,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -77216,14 +77215,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -82936,11 +82935,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -83572,14 +83571,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -84857,11 +84856,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -84990,14 +84989,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -85763,11 +85762,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -85812,14 +85811,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -87498,11 +87497,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -87712,14 +87711,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -88209,11 +88208,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -88228,14 +88227,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -88586,11 +88585,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -88605,14 +88604,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -90172,11 +90171,11 @@ relationships?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -90281,14 +90280,14 @@ relationships?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -90707,11 +90706,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -90726,14 +90725,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -96446,11 +96445,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -97082,14 +97081,14 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98127,11 +98126,11 @@ get contents(): ((string | LanguageString))[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } const instance = new this( @@ -98183,14 +98182,14 @@ get contents(): ((string | LanguageString))[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98598,11 +98597,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -98617,14 +98616,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -98971,11 +98970,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -98990,14 +98989,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -99560,11 +99559,11 @@ get formerTypes(): ($EntityType)[] { } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -99632,14 +99631,14 @@ get formerTypes(): ($EntityType)[] { if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100034,11 +100033,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -100053,14 +100052,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100412,11 +100411,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -100431,14 +100430,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -100788,11 +100787,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -100807,14 +100806,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -101164,11 +101163,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -101183,14 +101182,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( @@ -101536,11 +101535,11 @@ instruments?: (Object | URL)[];} } } - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } delete values["@type"]; @@ -101555,14 +101554,14 @@ instruments?: (Object | URL)[];} if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index b83461202..c84d9b855 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -269,18 +269,17 @@ export async function* generateClasses( depth = 0, parentKey?: string, portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): { value: unknown; changed: boolean } { - if (depth > 32 || key === "@context") return { value, changed: false }; +): unknown { + if (depth > 32 || key === "@context") return value; if (typeof value === "string") { if ( key != null && isPortableIriValuePosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ) { - const normalized = formatIri(value); - return { value: normalized, changed: normalized !== value }; + return formatIri(value); } - return { value, changed: false }; + return value; } if (Array.isArray(value)) { let clone: unknown[] | undefined; @@ -292,17 +291,17 @@ export async function* generateClasses( parentKey, portableIriKeys, ); - if (result.changed) { + if (result !== value[i]) { clone ??= value.slice(0, i); - clone.push(result.value); + clone.push(result); } else if (clone != null) { clone.push(value[i]); } } - return { value: clone ?? value, changed: clone != null }; + return clone ?? value; } if (value == null || typeof value !== "object") { - return { value, changed: false }; + return value; } const object = value as Record; let clone: Record | undefined; @@ -314,12 +313,12 @@ export async function* generateClasses( key, portableIriKeys, ); - if (result.changed) { + if (result !== object[entryKey]) { clone ??= { ...object }; - clone[entryKey] = result.value; + clone[entryKey] = result; } } - return { value: clone ?? object, changed: clone != null }; + return clone ?? object; }\n\n`; yield `function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index c3c269f0c..802b0c619 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -435,11 +435,11 @@ export async function* generateDecoder( } `; yield ` - const cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass + let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass ? normalizePortableIris(expanded) : undefined; - if (cacheJsonLd?.changed) { - cacheJsonLd.value = structuredClone(cacheJsonLd.value); + if (cacheJsonLd != null && cacheJsonLd !== expanded) { + cacheJsonLd = structuredClone(cacheJsonLd); } `; if (type.extends == null) { @@ -545,14 +545,14 @@ export async function* generateDecoder( yield ` if (!("_fromSubclass" in options) || !options._fromSubclass) { try { - if (cacheJsonLd?.changed) { + if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; const context = jsonLd != null && typeof jsonLd === "object" && !Array.isArray(jsonLd) && "@context" in jsonLd ? (jsonLd as Record)["@context"] : undefined; - const normalized = cacheJsonLd.value; + const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized : await mergeUnmappedJsonLdTerms( From ac223647539249baa949339ca0a44663ec6bad1f Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 14:56:20 +0900 Subject: [PATCH 29/55] Preserve expanded portable IRI cache shape Avoid wrapping normalized expanded JSON-LD arrays again when the original input was already a single expanded node. The cache now only re-wraps compact array input after context-based compaction, keeping expanded cache output stable. Also keep generated portable IRI key discovery robust for redundant property metadata and restore alphabetical runtime import order in the generated classes. https://github.com/fedify-dev/fedify/pull/850#discussion_r3496226295 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496226302 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496232251 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 326 +++++++++++++----- .../src/__snapshots__/class.test.ts.node.snap | 326 +++++++++++++----- .../src/__snapshots__/class.test.ts.snap | 326 +++++++++++++----- packages/vocab-tools/src/class.ts | 7 +- packages/vocab-tools/src/codec.ts | 4 +- packages/vocab/src/vocab.test.ts | 34 ++ 6 files changed, 774 insertions(+), 249 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index cbada2583..e6571c112 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -21,8 +21,8 @@ import { importPem, isDecimal, LanguageString, - parseIri, parseDecimal, + parseIri, type RemoteDocument } from \\"@fedify/vocab-runtime\\"; import { @@ -12186,7 +12186,9 @@ get urls(): ((URL | Link))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13421,7 +13423,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14566,7 +14570,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17990,7 +17996,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18518,7 +18526,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19110,7 +19120,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19730,7 +19742,9 @@ unit?: string | null;numericalValue?: Decimal | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20811,7 +20825,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21233,7 +21249,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21949,7 +21967,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22695,7 +22715,9 @@ get manualApprovals(): (URL)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23787,7 +23809,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24208,7 +24232,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25233,7 +25259,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25654,7 +25682,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26678,7 +26708,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27099,7 +27131,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27607,7 +27641,9 @@ get endpoints(): (URL)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27967,7 +28003,9 @@ endpoints?: (URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28932,7 +28970,9 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29913,7 +29953,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30845,7 +30887,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31486,7 +31530,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32103,7 +32149,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33012,7 +33060,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33892,7 +33942,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34350,7 +34402,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34725,7 +34779,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -35099,7 +35155,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41455,7 +41513,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42313,7 +42373,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42687,7 +42749,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43827,7 +43891,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44467,7 +44533,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44883,7 +44951,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45260,7 +45330,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45635,7 +45707,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -50005,7 +50079,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51610,7 +51686,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52041,7 +52119,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52414,7 +52494,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52785,7 +52867,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53728,7 +53812,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54239,7 +54325,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54613,7 +54701,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54988,7 +55078,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -61344,7 +61436,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63349,7 +63443,9 @@ get names(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63878,7 +63974,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64254,7 +64352,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64632,7 +64732,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65005,7 +65107,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65378,7 +65482,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65751,7 +65857,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66124,7 +66232,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66495,7 +66605,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66832,7 +66944,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67206,7 +67320,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68348,7 +68464,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69142,7 +69260,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69993,7 +70113,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76391,7 +76513,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -77239,7 +77363,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -83595,7 +83721,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85013,7 +85141,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85835,7 +85965,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87735,7 +87867,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88251,7 +88385,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88628,7 +88764,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90304,7 +90442,9 @@ relationships?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90749,7 +90889,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97105,7 +97247,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98206,7 +98350,9 @@ get contents(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98640,7 +98786,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99013,7 +99161,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99655,7 +99805,9 @@ get formerTypes(): (\$EntityType)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100076,7 +100228,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100454,7 +100608,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100830,7 +100986,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101206,7 +101364,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101578,7 +101738,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index a14179f20..f1dba31ff 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -19,8 +19,8 @@ import { importPem, isDecimal, LanguageString, - parseIri, parseDecimal, + parseIri, type RemoteDocument } from \\"@fedify/vocab-runtime\\"; import { @@ -12184,7 +12184,9 @@ get urls(): ((URL | Link))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13419,7 +13421,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14564,7 +14568,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17988,7 +17994,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18516,7 +18524,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19108,7 +19118,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19728,7 +19740,9 @@ unit?: string | null;numericalValue?: Decimal | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20809,7 +20823,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21231,7 +21247,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21947,7 +21965,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22693,7 +22713,9 @@ get manualApprovals(): (URL)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23785,7 +23807,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24206,7 +24230,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25231,7 +25257,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25652,7 +25680,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26676,7 +26706,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27097,7 +27129,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27605,7 +27639,9 @@ get endpoints(): (URL)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27965,7 +28001,9 @@ endpoints?: (URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28930,7 +28968,9 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29911,7 +29951,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30843,7 +30885,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31484,7 +31528,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32101,7 +32147,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33010,7 +33058,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33890,7 +33940,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34348,7 +34400,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34723,7 +34777,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -35097,7 +35153,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41453,7 +41511,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42311,7 +42371,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42685,7 +42747,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43825,7 +43889,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44465,7 +44531,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44881,7 +44949,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45258,7 +45328,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45633,7 +45705,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -50003,7 +50077,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51608,7 +51684,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52039,7 +52117,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52412,7 +52492,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52783,7 +52865,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53726,7 +53810,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54237,7 +54323,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54611,7 +54699,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54986,7 +55076,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -61342,7 +61434,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63347,7 +63441,9 @@ get names(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63876,7 +63972,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64252,7 +64350,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64630,7 +64730,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65003,7 +65105,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65376,7 +65480,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65749,7 +65855,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66122,7 +66230,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66493,7 +66603,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66830,7 +66942,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67204,7 +67318,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68346,7 +68462,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69140,7 +69258,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69991,7 +70111,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76389,7 +76511,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -77237,7 +77361,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -83593,7 +83719,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85011,7 +85139,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85833,7 +85963,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87733,7 +87865,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88249,7 +88383,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88626,7 +88762,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90302,7 +90440,9 @@ relationships?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90747,7 +90887,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97103,7 +97245,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98204,7 +98348,9 @@ get contents(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98638,7 +98784,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99011,7 +99159,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99653,7 +99803,9 @@ get formerTypes(): ($EntityType)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100074,7 +100226,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100452,7 +100606,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100828,7 +100984,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101204,7 +101362,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101576,7 +101736,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index d38305d1a..76cc7ef5c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -21,8 +21,8 @@ import { importPem, isDecimal, LanguageString, - parseIri, parseDecimal, + parseIri, type RemoteDocument } from "@fedify/vocab-runtime"; import { @@ -12186,7 +12186,9 @@ get urls(): ((URL | Link))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13421,7 +13423,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14566,7 +14570,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17990,7 +17996,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18518,7 +18526,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19110,7 +19120,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19730,7 +19742,9 @@ unit?: string | null;numericalValue?: Decimal | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20811,7 +20825,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21233,7 +21249,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21949,7 +21967,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22695,7 +22715,9 @@ get manualApprovals(): (URL)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23787,7 +23809,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24208,7 +24232,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25233,7 +25259,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25654,7 +25682,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26678,7 +26708,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27099,7 +27131,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27607,7 +27641,9 @@ get endpoints(): (URL)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27967,7 +28003,9 @@ endpoints?: (URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28932,7 +28970,9 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29913,7 +29953,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30845,7 +30887,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31486,7 +31530,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32103,7 +32149,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33012,7 +33060,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33892,7 +33942,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34350,7 +34402,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34725,7 +34779,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -35099,7 +35155,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41455,7 +41513,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42313,7 +42373,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42687,7 +42749,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43827,7 +43891,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44467,7 +44533,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44883,7 +44951,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45260,7 +45330,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45635,7 +45707,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -50005,7 +50079,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51610,7 +51686,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52041,7 +52119,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52414,7 +52494,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52785,7 +52867,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53728,7 +53812,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54239,7 +54325,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54613,7 +54701,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54988,7 +55078,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -61344,7 +61436,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63349,7 +63443,9 @@ get names(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63878,7 +63974,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64254,7 +64352,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64632,7 +64732,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65005,7 +65107,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65378,7 +65482,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65751,7 +65857,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66124,7 +66232,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66495,7 +66605,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66832,7 +66944,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67206,7 +67320,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68348,7 +68464,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69142,7 +69260,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69993,7 +70113,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76391,7 +76513,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -77239,7 +77363,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -83595,7 +83721,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85013,7 +85141,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85835,7 +85965,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87735,7 +87867,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88251,7 +88385,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -88628,7 +88764,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90304,7 +90442,9 @@ relationships?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -90749,7 +90889,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97105,7 +97247,9 @@ get preferredUsernames(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98206,7 +98350,9 @@ get contents(): ((string | LanguageString))[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98640,7 +98786,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99013,7 +99161,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99655,7 +99805,9 @@ get formerTypes(): ($EntityType)[] { context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100076,7 +100228,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100454,7 +100608,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100830,7 +100986,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101206,7 +101364,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -101578,7 +101738,9 @@ instruments?: (Object | URL)[];} context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index c84d9b855..054283c7c 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -193,7 +193,10 @@ function addPortableIriKeys( if (!canContainIriValue(property, types)) return; keys.add(property.uri); if (property.compactName != null) keys.add(property.compactName); - if (property.functional && property.redundantProperties != null) { + if ( + "redundantProperties" in property && + property.redundantProperties != null + ) { for (const redundantProperty of property.redundantProperties) { keys.add(redundantProperty.uri); if (redundantProperty.compactName != null) { @@ -227,8 +230,8 @@ export async function* generateClasses( "importPem", "isDecimal", "LanguageString", - "parseIri", "parseDecimal", + "parseIri", "type RemoteDocument", ]; yield "// deno-lint-ignore-file ban-unused-ignore no-explicit-any no-unused-vars prefer-const verbatim-module-syntax\n"; diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 802b0c619..b6ea846cc 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -569,7 +569,9 @@ export async function* generateDecoder( context, options.contextLoader, ); - instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; + instance._cachedJsonLd = compactArray && context != null + ? [cachedJsonLd] + : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 606ce4802..a864f7b4d 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -707,6 +707,40 @@ test("fromJsonLd() preserves expanded arrays with portable IRIs", async () => { ]); }); +test("fromJsonLd() preserves single-node expanded arrays with portable IRIs", async () => { + const expanded = [ + { + "@id": "ap://did:key:z6Mkabc/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attributedTo": [ + { "@id": "ap://did:key:z6Mkabc/actor" }, + ], + "https://www.w3.org/ns/activitystreams#content": [ + { "@value": "Single expanded node should stay cached as an array." }, + ], + }, + ]; + + const note = await Note.fromJsonLd(expanded, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await note.toJsonLd(), [ + { + "@id": "ap+ef61://did:key:z6Mkabc/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attributedTo": [ + { "@id": "ap+ef61://did:key:z6Mkabc/actor" }, + ], + "https://www.w3.org/ns/activitystreams#content": [ + { "@value": "Single expanded node should stay cached as an array." }, + ], + }, + ]); + deepStrictEqual(expanded[0]["@id"], "ap://did:key:z6Mkabc/objects/1"); +}); + test("fromJsonLd() preserves expanded subtype cache types", async () => { const expanded = [ { From cc075dd2a34f35ab5fb5f9d60c1cb726999dbc18 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 15:14:08 +0900 Subject: [PATCH 30/55] Preserve compact portable IRI array shape Keep generated portable IRI cache normalization from collapsing compact JSON-LD single-item arrays after context-based compaction. The cache now reapplies the original compact array shape to the compacted result, so toJsonLd() preserves caller-provided array structure while still rewriting portable IRI strings. https://github.com/fedify-dev/fedify/pull/850#discussion_r3496510079 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 1904 ++++++++++------- .../src/__snapshots__/class.test.ts.node.snap | 1904 ++++++++++------- .../src/__snapshots__/class.test.ts.snap | 1904 ++++++++++------- packages/vocab-tools/src/class.ts | 40 + packages/vocab-tools/src/codec.ts | 23 +- packages/vocab/src/vocab.test.ts | 22 + 6 files changed, 3357 insertions(+), 2440 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index e6571c112..d08216ba3 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -170,6 +170,47 @@ async function mergeUnmappedJsonLdTerms( return result; } +function preserveJsonLdArrayShape( + compacted: unknown, + original: unknown, +): unknown { + if ( + original == null || typeof original !== \\"object\\" || + compacted == null || typeof compacted !== \\"object\\" + ) { + return compacted; + } + if (Array.isArray(original)) { + if (!Array.isArray(compacted)) return compacted; + let clone: unknown[] | undefined; + for (let i = 0; i < compacted.length; i++) { + const value = preserveJsonLdArrayShape(compacted[i], original[i]); + if (value !== compacted[i]) { + clone ??= compacted.slice(0, i); + clone.push(value); + } else if (clone != null) { + clone.push(compacted[i]); + } + } + return clone ?? compacted; + } + if (Array.isArray(compacted)) return compacted; + let clone: Record | undefined; + const compactedObject = compacted as Record; + const originalObject = original as Record; + for (const key of globalThis.Object.keys(compactedObject)) { + const value = preserveJsonLdArrayShape(compactedObject[key], originalObject[key]); + const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) + ? [value] + : value; + if (shaped !== compactedObject[key]) { + clone ??= { ...compactedObject }; + clone[key] = shaped; + } + } + return clone ?? compactedObject; +} + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12172,19 +12213,22 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -13409,19 +13453,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -14556,19 +14603,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -17982,19 +18032,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -18512,19 +18565,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -19106,19 +19162,22 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -19728,19 +19787,22 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -20811,19 +20873,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -21235,19 +21300,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -21953,19 +22021,22 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -22701,19 +22772,22 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -23795,19 +23869,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -24218,19 +24295,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -25245,19 +25325,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -25668,19 +25751,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -26694,19 +26780,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27117,19 +27206,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27627,19 +27719,22 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27989,19 +28084,22 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -28956,19 +29054,22 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -29939,19 +30040,22 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -30873,19 +30977,22 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -31516,19 +31623,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -32135,19 +32245,22 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -33046,19 +33159,22 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -33928,19 +34044,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -34388,19 +34507,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -34765,19 +34887,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -35141,19 +35266,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -41499,19 +41627,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -42359,19 +42490,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -42735,19 +42869,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -43877,19 +44014,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -44519,19 +44659,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -44937,19 +45080,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -45316,19 +45462,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -45693,19 +45842,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -50065,19 +50217,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -51672,19 +51827,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52105,19 +52263,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52480,19 +52641,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52853,19 +53017,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -53798,19 +53965,22 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -54311,19 +54481,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -54687,19 +54860,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -55064,19 +55240,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -61422,19 +61601,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -63429,19 +63611,22 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -63960,19 +64145,22 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -64338,19 +64526,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -64718,19 +64909,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65093,19 +65287,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65468,19 +65665,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65843,19 +66043,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66218,19 +66421,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66591,19 +66797,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66930,19 +67139,22 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -67306,19 +67518,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -68450,19 +68665,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -69246,19 +69464,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -70099,19 +70320,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -76499,19 +76723,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -77349,19 +77576,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -83707,19 +83937,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -85127,19 +85360,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -85951,19 +86187,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -87853,19 +88092,22 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -88371,19 +88613,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -88750,19 +88995,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -90428,19 +90676,22 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -90875,19 +91126,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -97233,19 +97487,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -98336,19 +98593,22 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -98772,19 +99032,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -99147,19 +99410,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -99791,19 +100057,22 @@ get formerTypes(): (\$EntityType)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100214,19 +100483,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100594,19 +100866,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100972,19 +101247,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -101350,19 +101628,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -101724,19 +102005,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index f1dba31ff..bff2bb1e7 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -168,6 +168,47 @@ async function mergeUnmappedJsonLdTerms( return result; } +function preserveJsonLdArrayShape( + compacted: unknown, + original: unknown, +): unknown { + if ( + original == null || typeof original !== \\"object\\" || + compacted == null || typeof compacted !== \\"object\\" + ) { + return compacted; + } + if (Array.isArray(original)) { + if (!Array.isArray(compacted)) return compacted; + let clone: unknown[] | undefined; + for (let i = 0; i < compacted.length; i++) { + const value = preserveJsonLdArrayShape(compacted[i], original[i]); + if (value !== compacted[i]) { + clone ??= compacted.slice(0, i); + clone.push(value); + } else if (clone != null) { + clone.push(compacted[i]); + } + } + return clone ?? compacted; + } + if (Array.isArray(compacted)) return compacted; + let clone: Record | undefined; + const compactedObject = compacted as Record; + const originalObject = original as Record; + for (const key of globalThis.Object.keys(compactedObject)) { + const value = preserveJsonLdArrayShape(compactedObject[key], originalObject[key]); + const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) + ? [value] + : value; + if (shaped !== compactedObject[key]) { + clone ??= { ...compactedObject }; + clone[key] = shaped; + } + } + return clone ?? compactedObject; +} + import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12170,19 +12211,22 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -13407,19 +13451,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -14554,19 +14601,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -17980,19 +18030,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -18510,19 +18563,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -19104,19 +19160,22 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -19726,19 +19785,22 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -20809,19 +20871,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -21233,19 +21298,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -21951,19 +22019,22 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -22699,19 +22770,22 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -23793,19 +23867,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -24216,19 +24293,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -25243,19 +25323,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -25666,19 +25749,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -26692,19 +26778,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27115,19 +27204,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27625,19 +27717,22 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27987,19 +28082,22 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -28954,19 +29052,22 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -29937,19 +30038,22 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -30871,19 +30975,22 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -31514,19 +31621,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -32133,19 +32243,22 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -33044,19 +33157,22 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -33926,19 +34042,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -34386,19 +34505,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -34763,19 +34885,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -35139,19 +35264,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -41497,19 +41625,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -42357,19 +42488,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -42733,19 +42867,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -43875,19 +44012,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -44517,19 +44657,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -44935,19 +45078,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -45314,19 +45460,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -45691,19 +45840,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -50063,19 +50215,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -51670,19 +51825,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52103,19 +52261,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52478,19 +52639,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52851,19 +53015,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -53796,19 +53963,22 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -54309,19 +54479,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -54685,19 +54858,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -55062,19 +55238,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -61420,19 +61599,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -63427,19 +63609,22 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -63958,19 +64143,22 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -64336,19 +64524,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -64716,19 +64907,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65091,19 +65285,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65466,19 +65663,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65841,19 +66041,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66216,19 +66419,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66589,19 +66795,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66928,19 +67137,22 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -67304,19 +67516,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -68448,19 +68663,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -69244,19 +69462,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -70097,19 +70318,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -76497,19 +76721,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -77347,19 +77574,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -83705,19 +83935,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -85125,19 +85358,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -85949,19 +86185,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -87851,19 +88090,22 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -88369,19 +88611,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -88748,19 +88993,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -90426,19 +90674,22 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -90873,19 +91124,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -97231,19 +97485,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -98334,19 +98591,22 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -98770,19 +99030,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -99145,19 +99408,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -99789,19 +100055,22 @@ get formerTypes(): ($EntityType)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100212,19 +100481,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100592,19 +100864,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100970,19 +101245,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -101348,19 +101626,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -101722,19 +102003,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 76cc7ef5c..c3a0c03a8 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -170,6 +170,47 @@ async function mergeUnmappedJsonLdTerms( return result; } +function preserveJsonLdArrayShape( + compacted: unknown, + original: unknown, +): unknown { + if ( + original == null || typeof original !== "object" || + compacted == null || typeof compacted !== "object" + ) { + return compacted; + } + if (Array.isArray(original)) { + if (!Array.isArray(compacted)) return compacted; + let clone: unknown[] | undefined; + for (let i = 0; i < compacted.length; i++) { + const value = preserveJsonLdArrayShape(compacted[i], original[i]); + if (value !== compacted[i]) { + clone ??= compacted.slice(0, i); + clone.push(value); + } else if (clone != null) { + clone.push(compacted[i]); + } + } + return clone ?? compacted; + } + if (Array.isArray(compacted)) return compacted; + let clone: Record | undefined; + const compactedObject = compacted as Record; + const originalObject = original as Record; + for (const key of globalThis.Object.keys(compactedObject)) { + const value = preserveJsonLdArrayShape(compactedObject[key], originalObject[key]); + const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) + ? [value] + : value; + if (shaped !== compactedObject[key]) { + clone ??= { ...compactedObject }; + clone[key] = shaped; + } + } + return clone ?? compactedObject; +} + import * as _ppM0 from "./preprocessors.ts"; /** Describes an object of any kind. The Object type serves as the base type for @@ -12172,19 +12213,22 @@ get urls(): ((URL | Link))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -13409,19 +13453,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -14556,19 +14603,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -17982,19 +18032,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -18512,19 +18565,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -19106,19 +19162,22 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -19728,19 +19787,22 @@ unit?: string | null;numericalValue?: Decimal | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -20811,19 +20873,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -21235,19 +21300,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -21953,19 +22021,22 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -22701,19 +22772,22 @@ get manualApprovals(): (URL)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -23795,19 +23869,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -24218,19 +24295,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -25245,19 +25325,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -25668,19 +25751,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -26694,19 +26780,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27117,19 +27206,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27627,19 +27719,22 @@ get endpoints(): (URL)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -27989,19 +28084,22 @@ endpoints?: (URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -28956,19 +29054,22 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -29939,19 +30040,22 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -30873,19 +30977,22 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -31516,19 +31623,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -32135,19 +32245,22 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -33046,19 +33159,22 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -33928,19 +34044,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -34388,19 +34507,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -34765,19 +34887,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -35141,19 +35266,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -41499,19 +41627,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -42359,19 +42490,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -42735,19 +42869,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -43877,19 +44014,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -44519,19 +44659,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -44937,19 +45080,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -45316,19 +45462,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -45693,19 +45842,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -50065,19 +50217,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -51672,19 +51827,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52105,19 +52263,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52480,19 +52641,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -52853,19 +53017,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -53798,19 +53965,22 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -54311,19 +54481,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -54687,19 +54860,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -55064,19 +55240,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -61422,19 +61601,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -63429,19 +63611,22 @@ get names(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -63960,19 +64145,22 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -64338,19 +64526,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -64718,19 +64909,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65093,19 +65287,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65468,19 +65665,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -65843,19 +66043,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66218,19 +66421,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66591,19 +66797,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -66930,19 +67139,22 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -67306,19 +67518,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -68450,19 +68665,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -69246,19 +69464,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -70099,19 +70320,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -76499,19 +76723,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -77349,19 +77576,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -83707,19 +83937,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -85127,19 +85360,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -85951,19 +86187,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -87853,19 +88092,22 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -88371,19 +88613,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -88750,19 +88995,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -90428,19 +90676,22 @@ relationships?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -90875,19 +91126,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -97233,19 +97487,22 @@ get preferredUsernames(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -98336,19 +98593,22 @@ get contents(): ((string | LanguageString))[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -98772,19 +99032,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -99147,19 +99410,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -99791,19 +100057,22 @@ get formerTypes(): ($EntityType)[] { const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100214,19 +100483,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100594,19 +100866,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -100972,19 +101247,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -101350,19 +101628,22 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] @@ -101724,19 +102005,22 @@ instruments?: (Object | URL)[];} const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 054283c7c..7b8197d2c 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -388,6 +388,46 @@ export async function* generateClasses( } } return result; +}\n\n`; + yield `function preserveJsonLdArrayShape( + compacted: unknown, + original: unknown, +): unknown { + if ( + original == null || typeof original !== "object" || + compacted == null || typeof compacted !== "object" + ) { + return compacted; + } + if (Array.isArray(original)) { + if (!Array.isArray(compacted)) return compacted; + let clone: unknown[] | undefined; + for (let i = 0; i < compacted.length; i++) { + const value = preserveJsonLdArrayShape(compacted[i], original[i]); + if (value !== compacted[i]) { + clone ??= compacted.slice(0, i); + clone.push(value); + } else if (clone != null) { + clone.push(compacted[i]); + } + } + return clone ?? compacted; + } + if (Array.isArray(compacted)) return compacted; + let clone: Record | undefined; + const compactedObject = compacted as Record; + const originalObject = original as Record; + for (const key of globalThis.Object.keys(compactedObject)) { + const value = preserveJsonLdArrayShape(compactedObject[key], originalObject[key]); + const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) + ? [value] + : value; + if (shaped !== compactedObject[key]) { + clone ??= { ...compactedObject }; + clone[key] = shaped; + } + } + return clone ?? compactedObject; }\n\n`; const moduleVarNames = new Map(); const sorted = sortTopologically(types); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index b6ea846cc..8d662bcbf 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -555,19 +555,22 @@ export async function* generateDecoder( const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized - : await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, + : preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader: options.contextLoader, + }, + ), + jsonLd, context, - { - documentLoader: options.contextLoader, - }, + options.contextLoader, ), jsonLd, - context, - options.contextLoader, ); instance._cachedJsonLd = compactArray && context != null ? [cachedJsonLd] diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index a864f7b4d..bf032b7a4 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -808,6 +808,28 @@ test("fromJsonLd() preserves compact array contexts with portable IRIs", async ( }]); }); +test("fromJsonLd() preserves compact single-item arrays with portable IRIs", async () => { + const createJson = { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + actor: ["ap://did:key:z6Mkabc/actor"], + object: "https://example.com/objects/1", + }; + + const create = await Create.fromJsonLd(createJson, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await create.toJsonLd(), { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + actor: ["ap+ef61://did:key:z6Mkabc/actor"], + object: "https://example.com/objects/1", + }); + deepStrictEqual(createJson.actor, ["ap://did:key:z6Mkabc/actor"]); +}); + test("fromJsonLd() formats portable IRIs in JSON-LD containers", async () => { const note = await Note.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", From 4927e082ab77d91df610455eade5a7009e6245f1 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 15:33:25 +0900 Subject: [PATCH 31/55] Preserve compact array cache shape Handle portable IRI cache compaction for multi-node compact JSON-LD arrays by reusing contexts found inside array items and reshaping @graph output back to the caller-provided array form. Also bound the recursive shape pass and skip @context traversal while keeping the lazy clone behavior for unchanged subtrees. https://github.com/fedify-dev/fedify/pull/850#discussion_r3496568199 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496589551 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 467 +++++------------- .../src/__snapshots__/class.test.ts.node.snap | 467 +++++------------- .../src/__snapshots__/class.test.ts.snap | 467 +++++------------- packages/vocab-tools/src/class.ts | 61 ++- packages/vocab-tools/src/codec.ts | 5 +- packages/vocab/src/vocab.test.ts | 39 ++ 6 files changed, 494 insertions(+), 1012 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index d08216ba3..1d545585d 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -102,6 +102,23 @@ function normalizePortableIris( return clone ?? object; } +function getJsonLdContext(value: unknown): unknown { + if (Array.isArray(value)) { + for (const item of value) { + const context = getJsonLdContext(item); + if (context !== undefined) return context; + } + return undefined; + } + if ( + value == null || typeof value !== \\"object\\" || + !(\\"@context\\" in value) + ) { + return undefined; + } + return (value as Record)[\\"@context\\"]; +} + function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); const nodes = Array.isArray(value) ? value : [value]; @@ -173,7 +190,9 @@ async function mergeUnmappedJsonLdTerms( function preserveJsonLdArrayShape( compacted: unknown, original: unknown, + depth = 0, ): unknown { + if (depth > 32) return compacted; if ( original == null || typeof original !== \\"object\\" || compacted == null || typeof compacted !== \\"object\\" @@ -181,25 +200,50 @@ function preserveJsonLdArrayShape( return compacted; } if (Array.isArray(original)) { - if (!Array.isArray(compacted)) return compacted; + const compactedArray = Array.isArray(compacted) + ? compacted + : \\"@graph\\" in compacted && + Array.isArray((compacted as Record)[\\"@graph\\"]) + ? (compacted as Record)[\\"@graph\\"] as unknown[] + : undefined; + if (compactedArray == null) return compacted; let clone: unknown[] | undefined; - for (let i = 0; i < compacted.length; i++) { - const value = preserveJsonLdArrayShape(compacted[i], original[i]); - if (value !== compacted[i]) { - clone ??= compacted.slice(0, i); - clone.push(value); + for (let i = 0; i < compactedArray.length; i++) { + const value = preserveJsonLdArrayShape( + compactedArray[i], + original[i], + depth + 1, + ); + const originalContext = original[i] != null && + typeof original[i] === \\"object\\" && !Array.isArray(original[i]) && + \\"@context\\" in original[i] + ? (original[i] as Record)[\\"@context\\"] + : undefined; + const shaped = originalContext !== undefined && + value != null && typeof value === \\"object\\" && + !Array.isArray(value) && !(\\"@context\\" in value) + ? { \\"@context\\": originalContext, ...value as Record } + : value; + if (shaped !== compactedArray[i]) { + clone ??= compactedArray.slice(0, i); + clone.push(shaped); } else if (clone != null) { - clone.push(compacted[i]); + clone.push(compactedArray[i]); } } - return clone ?? compacted; + return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); } if (Array.isArray(compacted)) return compacted; let clone: Record | undefined; const compactedObject = compacted as Record; const originalObject = original as Record; for (const key of globalThis.Object.keys(compactedObject)) { - const value = preserveJsonLdArrayShape(compactedObject[key], originalObject[key]); + if (key === \\"@context\\") continue; + const value = preserveJsonLdArrayShape( + compactedObject[key], + originalObject[key], + depth + 1, + ); const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) ? [value] : value; @@ -12206,10 +12250,7 @@ get urls(): ((URL | Link))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -13446,10 +13487,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -14596,10 +14634,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -18025,10 +18060,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -18558,10 +18590,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -19155,10 +19184,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -19780,10 +19806,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -20866,10 +20889,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -21293,10 +21313,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -22014,10 +22031,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -22765,10 +22779,7 @@ get manualApprovals(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -23862,10 +23873,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -24288,10 +24296,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -25318,10 +25323,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -25744,10 +25746,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -26773,10 +26772,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -27199,10 +27195,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -27712,10 +27705,7 @@ get endpoints(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -28077,10 +28067,7 @@ endpoints?: (URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -29047,10 +29034,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -30033,10 +30017,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -30970,10 +30951,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -31616,10 +31594,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -32238,10 +32213,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -33152,10 +33124,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34037,10 +34006,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34500,10 +34466,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34880,10 +34843,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -35259,10 +35219,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -41620,10 +41577,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -42483,10 +42437,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -42862,10 +42813,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -44007,10 +43955,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -44652,10 +44597,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45073,10 +45015,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45455,10 +45394,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45835,10 +45771,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -50210,10 +50143,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -51820,10 +51750,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -52256,10 +52183,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -52634,10 +52558,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -53010,10 +52931,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -53958,10 +53876,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -54474,10 +54389,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -54853,10 +54765,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -55233,10 +55142,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -61594,10 +61500,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -63604,10 +63507,7 @@ get names(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64138,10 +64038,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64519,10 +64416,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64902,10 +64796,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -65280,10 +65171,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -65658,10 +65546,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66036,10 +65921,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66414,10 +66296,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66790,10 +66669,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -67132,10 +67008,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -67511,10 +67384,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -68658,10 +68528,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -69457,10 +69324,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -70313,10 +70177,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -76716,10 +76577,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -77569,10 +77427,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -83930,10 +83785,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -85353,10 +85205,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -86180,10 +86029,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88085,10 +87931,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88606,10 +88449,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88988,10 +88828,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -90669,10 +90506,7 @@ relationships?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -91119,10 +90953,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -97480,10 +97311,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -98586,10 +98414,7 @@ get contents(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -99025,10 +98850,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -99403,10 +99225,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100050,10 +99869,7 @@ get formerTypes(): (\$EntityType)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100476,10 +100292,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100859,10 +100672,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101240,10 +101050,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101621,10 +101428,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101998,10 +101802,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index bff2bb1e7..deccd5d41 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -100,6 +100,23 @@ function normalizePortableIris( return clone ?? object; } +function getJsonLdContext(value: unknown): unknown { + if (Array.isArray(value)) { + for (const item of value) { + const context = getJsonLdContext(item); + if (context !== undefined) return context; + } + return undefined; + } + if ( + value == null || typeof value !== \\"object\\" || + !(\\"@context\\" in value) + ) { + return undefined; + } + return (value as Record)[\\"@context\\"]; +} + function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); const nodes = Array.isArray(value) ? value : [value]; @@ -171,7 +188,9 @@ async function mergeUnmappedJsonLdTerms( function preserveJsonLdArrayShape( compacted: unknown, original: unknown, + depth = 0, ): unknown { + if (depth > 32) return compacted; if ( original == null || typeof original !== \\"object\\" || compacted == null || typeof compacted !== \\"object\\" @@ -179,25 +198,50 @@ function preserveJsonLdArrayShape( return compacted; } if (Array.isArray(original)) { - if (!Array.isArray(compacted)) return compacted; + const compactedArray = Array.isArray(compacted) + ? compacted + : \\"@graph\\" in compacted && + Array.isArray((compacted as Record)[\\"@graph\\"]) + ? (compacted as Record)[\\"@graph\\"] as unknown[] + : undefined; + if (compactedArray == null) return compacted; let clone: unknown[] | undefined; - for (let i = 0; i < compacted.length; i++) { - const value = preserveJsonLdArrayShape(compacted[i], original[i]); - if (value !== compacted[i]) { - clone ??= compacted.slice(0, i); - clone.push(value); + for (let i = 0; i < compactedArray.length; i++) { + const value = preserveJsonLdArrayShape( + compactedArray[i], + original[i], + depth + 1, + ); + const originalContext = original[i] != null && + typeof original[i] === \\"object\\" && !Array.isArray(original[i]) && + \\"@context\\" in original[i] + ? (original[i] as Record)[\\"@context\\"] + : undefined; + const shaped = originalContext !== undefined && + value != null && typeof value === \\"object\\" && + !Array.isArray(value) && !(\\"@context\\" in value) + ? { \\"@context\\": originalContext, ...value as Record } + : value; + if (shaped !== compactedArray[i]) { + clone ??= compactedArray.slice(0, i); + clone.push(shaped); } else if (clone != null) { - clone.push(compacted[i]); + clone.push(compactedArray[i]); } } - return clone ?? compacted; + return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); } if (Array.isArray(compacted)) return compacted; let clone: Record | undefined; const compactedObject = compacted as Record; const originalObject = original as Record; for (const key of globalThis.Object.keys(compactedObject)) { - const value = preserveJsonLdArrayShape(compactedObject[key], originalObject[key]); + if (key === \\"@context\\") continue; + const value = preserveJsonLdArrayShape( + compactedObject[key], + originalObject[key], + depth + 1, + ); const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) ? [value] : value; @@ -12204,10 +12248,7 @@ get urls(): ((URL | Link))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -13444,10 +13485,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -14594,10 +14632,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -18023,10 +18058,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -18556,10 +18588,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -19153,10 +19182,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -19778,10 +19804,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -20864,10 +20887,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -21291,10 +21311,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -22012,10 +22029,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -22763,10 +22777,7 @@ get manualApprovals(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -23860,10 +23871,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -24286,10 +24294,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -25316,10 +25321,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -25742,10 +25744,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -26771,10 +26770,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -27197,10 +27193,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -27710,10 +27703,7 @@ get endpoints(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -28075,10 +28065,7 @@ endpoints?: (URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -29045,10 +29032,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -30031,10 +30015,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -30968,10 +30949,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -31614,10 +31592,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -32236,10 +32211,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -33150,10 +33122,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34035,10 +34004,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34498,10 +34464,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34878,10 +34841,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -35257,10 +35217,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -41618,10 +41575,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -42481,10 +42435,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -42860,10 +42811,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -44005,10 +43953,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -44650,10 +44595,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45071,10 +45013,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45453,10 +45392,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45833,10 +45769,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -50208,10 +50141,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -51818,10 +51748,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -52254,10 +52181,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -52632,10 +52556,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -53008,10 +52929,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -53956,10 +53874,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -54472,10 +54387,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -54851,10 +54763,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -55231,10 +55140,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -61592,10 +61498,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -63602,10 +63505,7 @@ get names(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64136,10 +64036,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64517,10 +64414,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64900,10 +64794,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -65278,10 +65169,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -65656,10 +65544,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66034,10 +65919,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66412,10 +66294,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66788,10 +66667,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -67130,10 +67006,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -67509,10 +67382,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -68656,10 +68526,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -69455,10 +69322,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -70311,10 +70175,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -76714,10 +76575,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -77567,10 +77425,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -83928,10 +83783,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -85351,10 +85203,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -86178,10 +86027,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88083,10 +87929,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88604,10 +88447,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88986,10 +88826,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -90667,10 +90504,7 @@ relationships?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -91117,10 +90951,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -97478,10 +97309,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -98584,10 +98412,7 @@ get contents(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -99023,10 +98848,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -99401,10 +99223,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100048,10 +99867,7 @@ get formerTypes(): ($EntityType)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100474,10 +100290,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100857,10 +100670,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101238,10 +101048,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101619,10 +101426,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101996,10 +101800,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === \\"object\\" && - !Array.isArray(jsonLd) && \\"@context\\" in jsonLd - ? (jsonLd as Record)[\\"@context\\"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index c3a0c03a8..2cfe840c2 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -102,6 +102,23 @@ function normalizePortableIris( return clone ?? object; } +function getJsonLdContext(value: unknown): unknown { + if (Array.isArray(value)) { + for (const item of value) { + const context = getJsonLdContext(item); + if (context !== undefined) return context; + } + return undefined; + } + if ( + value == null || typeof value !== "object" || + !("@context" in value) + ) { + return undefined; + } + return (value as Record)["@context"]; +} + function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); const nodes = Array.isArray(value) ? value : [value]; @@ -173,7 +190,9 @@ async function mergeUnmappedJsonLdTerms( function preserveJsonLdArrayShape( compacted: unknown, original: unknown, + depth = 0, ): unknown { + if (depth > 32) return compacted; if ( original == null || typeof original !== "object" || compacted == null || typeof compacted !== "object" @@ -181,25 +200,50 @@ function preserveJsonLdArrayShape( return compacted; } if (Array.isArray(original)) { - if (!Array.isArray(compacted)) return compacted; + const compactedArray = Array.isArray(compacted) + ? compacted + : "@graph" in compacted && + Array.isArray((compacted as Record)["@graph"]) + ? (compacted as Record)["@graph"] as unknown[] + : undefined; + if (compactedArray == null) return compacted; let clone: unknown[] | undefined; - for (let i = 0; i < compacted.length; i++) { - const value = preserveJsonLdArrayShape(compacted[i], original[i]); - if (value !== compacted[i]) { - clone ??= compacted.slice(0, i); - clone.push(value); + for (let i = 0; i < compactedArray.length; i++) { + const value = preserveJsonLdArrayShape( + compactedArray[i], + original[i], + depth + 1, + ); + const originalContext = original[i] != null && + typeof original[i] === "object" && !Array.isArray(original[i]) && + "@context" in original[i] + ? (original[i] as Record)["@context"] + : undefined; + const shaped = originalContext !== undefined && + value != null && typeof value === "object" && + !Array.isArray(value) && !("@context" in value) + ? { "@context": originalContext, ...value as Record } + : value; + if (shaped !== compactedArray[i]) { + clone ??= compactedArray.slice(0, i); + clone.push(shaped); } else if (clone != null) { - clone.push(compacted[i]); + clone.push(compactedArray[i]); } } - return clone ?? compacted; + return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); } if (Array.isArray(compacted)) return compacted; let clone: Record | undefined; const compactedObject = compacted as Record; const originalObject = original as Record; for (const key of globalThis.Object.keys(compactedObject)) { - const value = preserveJsonLdArrayShape(compactedObject[key], originalObject[key]); + if (key === "@context") continue; + const value = preserveJsonLdArrayShape( + compactedObject[key], + originalObject[key], + depth + 1, + ); const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) ? [value] : value; @@ -12206,10 +12250,7 @@ get urls(): ((URL | Link))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -13446,10 +13487,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -14596,10 +14634,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -18025,10 +18060,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -18558,10 +18590,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -19155,10 +19184,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -19780,10 +19806,7 @@ unit?: string | null;numericalValue?: Decimal | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -20866,10 +20889,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -21293,10 +21313,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -22014,10 +22031,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -22765,10 +22779,7 @@ get manualApprovals(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -23862,10 +23873,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -24288,10 +24296,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -25318,10 +25323,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -25744,10 +25746,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -26773,10 +26772,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -27199,10 +27195,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -27712,10 +27705,7 @@ get endpoints(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -28077,10 +28067,7 @@ endpoints?: (URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -29047,10 +29034,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -30033,10 +30017,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -30970,10 +30951,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -31616,10 +31594,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -32238,10 +32213,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -33152,10 +33124,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34037,10 +34006,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34500,10 +34466,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -34880,10 +34843,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -35259,10 +35219,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -41620,10 +41577,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -42483,10 +42437,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -42862,10 +42813,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -44007,10 +43955,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -44652,10 +44597,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45073,10 +45015,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45455,10 +45394,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -45835,10 +45771,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -50210,10 +50143,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -51820,10 +51750,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -52256,10 +52183,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -52634,10 +52558,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -53010,10 +52931,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -53958,10 +53876,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -54474,10 +54389,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -54853,10 +54765,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -55233,10 +55142,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -61594,10 +61500,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -63604,10 +63507,7 @@ get names(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64138,10 +64038,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64519,10 +64416,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -64902,10 +64796,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -65280,10 +65171,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -65658,10 +65546,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66036,10 +65921,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66414,10 +66296,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -66790,10 +66669,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -67132,10 +67008,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -67511,10 +67384,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -68658,10 +68528,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -69457,10 +69324,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -70313,10 +70177,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -76716,10 +76577,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -77569,10 +77427,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -83930,10 +83785,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -85353,10 +85205,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -86180,10 +86029,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88085,10 +87931,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88606,10 +88449,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -88988,10 +88828,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -90669,10 +90506,7 @@ relationships?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -91119,10 +90953,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -97480,10 +97311,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -98586,10 +98414,7 @@ get contents(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -99025,10 +98850,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -99403,10 +99225,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100050,10 +99869,7 @@ get formerTypes(): ($EntityType)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100476,10 +100292,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -100859,10 +100672,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101240,10 +101050,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101621,10 +101428,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized @@ -101998,10 +101802,7 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 7b8197d2c..3ef38dfef 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -322,6 +322,22 @@ export async function* generateClasses( } } return clone ?? object; +}\n\n`; + yield `function getJsonLdContext(value: unknown): unknown { + if (Array.isArray(value)) { + for (const item of value) { + const context = getJsonLdContext(item); + if (context !== undefined) return context; + } + return undefined; + } + if ( + value == null || typeof value !== "object" || + !("@context" in value) + ) { + return undefined; + } + return (value as Record)["@context"]; }\n\n`; yield `function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); @@ -392,7 +408,9 @@ export async function* generateClasses( yield `function preserveJsonLdArrayShape( compacted: unknown, original: unknown, + depth = 0, ): unknown { + if (depth > 32) return compacted; if ( original == null || typeof original !== "object" || compacted == null || typeof compacted !== "object" @@ -400,25 +418,50 @@ export async function* generateClasses( return compacted; } if (Array.isArray(original)) { - if (!Array.isArray(compacted)) return compacted; + const compactedArray = Array.isArray(compacted) + ? compacted + : "@graph" in compacted && + Array.isArray((compacted as Record)["@graph"]) + ? (compacted as Record)["@graph"] as unknown[] + : undefined; + if (compactedArray == null) return compacted; let clone: unknown[] | undefined; - for (let i = 0; i < compacted.length; i++) { - const value = preserveJsonLdArrayShape(compacted[i], original[i]); - if (value !== compacted[i]) { - clone ??= compacted.slice(0, i); - clone.push(value); + for (let i = 0; i < compactedArray.length; i++) { + const value = preserveJsonLdArrayShape( + compactedArray[i], + original[i], + depth + 1, + ); + const originalContext = original[i] != null && + typeof original[i] === "object" && !Array.isArray(original[i]) && + "@context" in original[i] + ? (original[i] as Record)["@context"] + : undefined; + const shaped = originalContext !== undefined && + value != null && typeof value === "object" && + !Array.isArray(value) && !("@context" in value) + ? { "@context": originalContext, ...value as Record } + : value; + if (shaped !== compactedArray[i]) { + clone ??= compactedArray.slice(0, i); + clone.push(shaped); } else if (clone != null) { - clone.push(compacted[i]); + clone.push(compactedArray[i]); } } - return clone ?? compacted; + return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); } if (Array.isArray(compacted)) return compacted; let clone: Record | undefined; const compactedObject = compacted as Record; const originalObject = original as Record; for (const key of globalThis.Object.keys(compactedObject)) { - const value = preserveJsonLdArrayShape(compactedObject[key], originalObject[key]); + if (key === "@context") continue; + const value = preserveJsonLdArrayShape( + compactedObject[key], + originalObject[key], + depth + 1, + ); const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) ? [value] : value; diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 8d662bcbf..8e4d3ce1b 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -548,10 +548,7 @@ export async function* generateDecoder( if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = jsonLd != null && typeof jsonLd === "object" && - !Array.isArray(jsonLd) && "@context" in jsonLd - ? (jsonLd as Record)["@context"] - : undefined; + const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; const cachedJsonLd = context == null ? normalized diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index bf032b7a4..aa10f053a 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -830,6 +830,45 @@ test("fromJsonLd() preserves compact single-item arrays with portable IRIs", asy deepStrictEqual(createJson.actor, ["ap://did:key:z6Mkabc/actor"]); }); +test("fromJsonLd() preserves compact multi-node arrays with portable IRIs", async () => { + const activityJson = [ + { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + id: "https://example.com/activities/1", + actor: "https://example.com/actors/alice", + object: "https://example.com/objects/1", + }, + { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: "https://example.com/objects/1", + attributedTo: "ap://did:key:z6Mkabc/actor", + }, + ]; + + const activity = await Activity.fromJsonLd(activityJson, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await activity.toJsonLd(), [ + { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + id: "https://example.com/activities/1", + actor: "https://example.com/actors/alice", + object: "https://example.com/objects/1", + }, + { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: "https://example.com/objects/1", + attributedTo: "ap+ef61://did:key:z6Mkabc/actor", + }, + ]); +}); + test("fromJsonLd() formats portable IRIs in JSON-LD containers", async () => { const note = await Note.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", From d8358fe327ecf17ce78edac973c6266268874d40 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 15:47:33 +0900 Subject: [PATCH 32/55] Compact cache with item contexts Keep portable IRI cache compaction best effort by leaving malformed portable-looking extension IRIs unchanged instead of letting cache normalization throw. Compact JSON-LD array cache entries item by item so later nodes can use their own extension contexts and preserve caller-provided aliases. https://github.com/fedify-dev/fedify/pull/850#discussion_r3496671094 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496671099 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 2248 ++++------------- .../src/__snapshots__/class.test.ts.node.snap | 2248 ++++------------- .../src/__snapshots__/class.test.ts.snap | 2248 ++++------------- packages/vocab-tools/src/class.ts | 59 +- packages/vocab-tools/src/codec.ts | 27 +- packages/vocab/src/vocab.test.ts | 79 + 6 files changed, 1781 insertions(+), 5128 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 1d545585d..2ac99367c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -44,6 +44,14 @@ function isPortableIriValuePosition( parentKey != null && portableIriKeys.has(parentKey)); } +function formatPortableIriForCache(value: string): string { + try { + return formatIri(value); + } catch { + return value; + } +} + function normalizePortableIris( value: unknown, key?: string, @@ -58,7 +66,7 @@ function normalizePortableIris( isPortableIriValuePosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ) { - return formatIri(value); + return formatPortableIriForCache(value); } return value; } @@ -119,6 +127,57 @@ function getJsonLdContext(value: unknown): unknown { return (value as Record)[\\"@context\\"]; } +async function compactJsonLdCache( + normalized: unknown, + original: unknown, + documentLoader?: DocumentLoader, +): Promise { + if (Array.isArray(original)) { + const normalizedArray = Array.isArray(normalized) + ? normalized + : normalized != null && typeof normalized === \\"object\\" && + \\"@graph\\" in normalized && + Array.isArray((normalized as Record)[\\"@graph\\"]) + ? (normalized as Record)[\\"@graph\\"] as unknown[] + : undefined; + if (normalizedArray == null) return normalized; + let clone: unknown[] | undefined; + for (let i = 0; i < normalizedArray.length; i++) { + const item = await compactJsonLdCache( + normalizedArray[i], + original[i], + documentLoader, + ); + if (item !== normalizedArray[i]) { + clone ??= normalizedArray.slice(0, i); + clone.push(item); + } else if (clone != null) { + clone.push(normalizedArray[i]); + } + } + return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); + } + const context = getJsonLdContext(original); + if (context == null) return normalized; + return preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader, + }, + ), + original, + context, + documentLoader, + ), + original, + ); +} + function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); const nodes = Array.isArray(value) ? value : [value]; @@ -12250,28 +12309,13 @@ get urls(): ((URL | Link))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -13487,28 +13531,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -14634,28 +14663,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -18060,28 +18074,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -18590,28 +18589,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -19184,28 +19168,13 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -19806,28 +19775,13 @@ unit?: string | null;numericalValue?: Decimal | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -20889,28 +20843,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -21313,28 +21252,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -22031,28 +21955,13 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -22779,28 +22688,13 @@ get manualApprovals(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -23873,28 +23767,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -24296,28 +24175,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -25323,28 +25187,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -25746,28 +25595,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -26772,28 +26606,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -27195,28 +27014,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -27705,28 +27509,13 @@ get endpoints(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -28067,28 +27856,13 @@ endpoints?: (URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -29034,28 +28808,13 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -30017,28 +29776,13 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -30951,28 +30695,13 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -31594,28 +31323,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -32213,28 +31927,13 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -33124,28 +32823,13 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34006,28 +33690,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34466,28 +34135,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34843,28 +34497,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -35219,28 +34858,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -41577,28 +41201,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -42437,28 +42046,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -42813,28 +42407,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -43955,28 +43534,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -44597,28 +44161,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45015,28 +44564,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45394,28 +44928,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45771,28 +45290,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -50143,28 +49647,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -51750,28 +51239,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52183,28 +51657,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52558,28 +52017,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52931,28 +52375,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -53876,28 +53305,13 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -54389,28 +53803,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -54765,28 +54164,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -55142,28 +54526,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -61500,28 +60869,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -63507,28 +62861,13 @@ get names(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64038,28 +63377,13 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64416,28 +63740,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64796,28 +64105,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65171,28 +64465,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65546,28 +64825,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65921,28 +65185,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -66296,28 +65545,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -66669,28 +65903,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -67008,28 +66227,13 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -67384,28 +66588,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -68528,28 +67717,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -69324,28 +68498,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -70177,28 +69336,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -76577,28 +75721,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -77427,28 +76556,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -83785,28 +82899,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -85205,28 +84304,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -86029,28 +85113,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -87931,28 +87000,13 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -88449,28 +87503,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -88828,28 +87867,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -90506,28 +89530,13 @@ relationships?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -90953,28 +89962,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -97311,28 +96305,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -98414,28 +97393,13 @@ get contents(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -98850,28 +97814,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -99225,28 +98174,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -99869,28 +98803,13 @@ get formerTypes(): (\$EntityType)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -100292,28 +99211,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -100672,28 +99576,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101050,28 +99939,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101428,28 +100302,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101802,28 +100661,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index deccd5d41..5b111aa53 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -42,6 +42,14 @@ function isPortableIriValuePosition( parentKey != null && portableIriKeys.has(parentKey)); } +function formatPortableIriForCache(value: string): string { + try { + return formatIri(value); + } catch { + return value; + } +} + function normalizePortableIris( value: unknown, key?: string, @@ -56,7 +64,7 @@ function normalizePortableIris( isPortableIriValuePosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ) { - return formatIri(value); + return formatPortableIriForCache(value); } return value; } @@ -117,6 +125,57 @@ function getJsonLdContext(value: unknown): unknown { return (value as Record)[\\"@context\\"]; } +async function compactJsonLdCache( + normalized: unknown, + original: unknown, + documentLoader?: DocumentLoader, +): Promise { + if (Array.isArray(original)) { + const normalizedArray = Array.isArray(normalized) + ? normalized + : normalized != null && typeof normalized === \\"object\\" && + \\"@graph\\" in normalized && + Array.isArray((normalized as Record)[\\"@graph\\"]) + ? (normalized as Record)[\\"@graph\\"] as unknown[] + : undefined; + if (normalizedArray == null) return normalized; + let clone: unknown[] | undefined; + for (let i = 0; i < normalizedArray.length; i++) { + const item = await compactJsonLdCache( + normalizedArray[i], + original[i], + documentLoader, + ); + if (item !== normalizedArray[i]) { + clone ??= normalizedArray.slice(0, i); + clone.push(item); + } else if (clone != null) { + clone.push(normalizedArray[i]); + } + } + return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); + } + const context = getJsonLdContext(original); + if (context == null) return normalized; + return preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader, + }, + ), + original, + context, + documentLoader, + ), + original, + ); +} + function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); const nodes = Array.isArray(value) ? value : [value]; @@ -12248,28 +12307,13 @@ get urls(): ((URL | Link))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -13485,28 +13529,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -14632,28 +14661,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -18058,28 +18072,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -18588,28 +18587,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -19182,28 +19166,13 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -19804,28 +19773,13 @@ unit?: string | null;numericalValue?: Decimal | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -20887,28 +20841,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -21311,28 +21250,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -22029,28 +21953,13 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -22777,28 +22686,13 @@ get manualApprovals(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -23871,28 +23765,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -24294,28 +24173,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -25321,28 +25185,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -25744,28 +25593,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -26770,28 +26604,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -27193,28 +27012,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -27703,28 +27507,13 @@ get endpoints(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -28065,28 +27854,13 @@ endpoints?: (URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -29032,28 +28806,13 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -30015,28 +29774,13 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -30949,28 +30693,13 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -31592,28 +31321,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -32211,28 +31925,13 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -33122,28 +32821,13 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34004,28 +33688,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34464,28 +34133,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34841,28 +34495,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -35217,28 +34856,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -41575,28 +41199,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -42435,28 +42044,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -42811,28 +42405,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -43953,28 +43532,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -44595,28 +44159,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45013,28 +44562,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45392,28 +44926,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45769,28 +45288,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -50141,28 +49645,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -51748,28 +51237,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52181,28 +51655,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52556,28 +52015,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52929,28 +52373,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -53874,28 +53303,13 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -54387,28 +53801,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -54763,28 +54162,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -55140,28 +54524,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -61498,28 +60867,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -63505,28 +62859,13 @@ get names(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64036,28 +63375,13 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64414,28 +63738,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64794,28 +64103,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65169,28 +64463,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65544,28 +64823,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65919,28 +65183,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -66294,28 +65543,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -66667,28 +65901,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -67006,28 +66225,13 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -67382,28 +66586,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -68526,28 +67715,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -69322,28 +68496,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -70175,28 +69334,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -76575,28 +75719,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -77425,28 +76554,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -83783,28 +82897,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -85203,28 +84302,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -86027,28 +85111,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -87929,28 +86998,13 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -88447,28 +87501,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -88826,28 +87865,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -90504,28 +89528,13 @@ relationships?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -90951,28 +89960,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -97309,28 +96303,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -98412,28 +97391,13 @@ get contents(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -98848,28 +97812,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -99223,28 +98172,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -99867,28 +98801,13 @@ get formerTypes(): ($EntityType)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -100290,28 +99209,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -100670,28 +99574,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101048,28 +99937,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101426,28 +100300,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101800,28 +100659,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 2cfe840c2..0f978751d 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -44,6 +44,14 @@ function isPortableIriValuePosition( parentKey != null && portableIriKeys.has(parentKey)); } +function formatPortableIriForCache(value: string): string { + try { + return formatIri(value); + } catch { + return value; + } +} + function normalizePortableIris( value: unknown, key?: string, @@ -58,7 +66,7 @@ function normalizePortableIris( isPortableIriValuePosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ) { - return formatIri(value); + return formatPortableIriForCache(value); } return value; } @@ -119,6 +127,57 @@ function getJsonLdContext(value: unknown): unknown { return (value as Record)["@context"]; } +async function compactJsonLdCache( + normalized: unknown, + original: unknown, + documentLoader?: DocumentLoader, +): Promise { + if (Array.isArray(original)) { + const normalizedArray = Array.isArray(normalized) + ? normalized + : normalized != null && typeof normalized === "object" && + "@graph" in normalized && + Array.isArray((normalized as Record)["@graph"]) + ? (normalized as Record)["@graph"] as unknown[] + : undefined; + if (normalizedArray == null) return normalized; + let clone: unknown[] | undefined; + for (let i = 0; i < normalizedArray.length; i++) { + const item = await compactJsonLdCache( + normalizedArray[i], + original[i], + documentLoader, + ); + if (item !== normalizedArray[i]) { + clone ??= normalizedArray.slice(0, i); + clone.push(item); + } else if (clone != null) { + clone.push(normalizedArray[i]); + } + } + return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); + } + const context = getJsonLdContext(original); + if (context == null) return normalized; + return preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader, + }, + ), + original, + context, + documentLoader, + ), + original, + ); +} + function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); const nodes = Array.isArray(value) ? value : [value]; @@ -12250,28 +12309,13 @@ get urls(): ((URL | Link))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -13487,28 +13531,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -14634,28 +14663,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -18060,28 +18074,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -18590,28 +18589,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -19184,28 +19168,13 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -19806,28 +19775,13 @@ unit?: string | null;numericalValue?: Decimal | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -20889,28 +20843,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -21313,28 +21252,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -22031,28 +21955,13 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -22779,28 +22688,13 @@ get manualApprovals(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -23873,28 +23767,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -24296,28 +24175,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -25323,28 +25187,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -25746,28 +25595,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -26772,28 +26606,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -27195,28 +27014,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -27705,28 +27509,13 @@ get endpoints(): (URL)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -28067,28 +27856,13 @@ endpoints?: (URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -29034,28 +28808,13 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -30017,28 +29776,13 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -30951,28 +30695,13 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -31594,28 +31323,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -32213,28 +31927,13 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -33124,28 +32823,13 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34006,28 +33690,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34466,28 +34135,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -34843,28 +34497,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -35219,28 +34858,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -41577,28 +41201,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -42437,28 +42046,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -42813,28 +42407,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -43955,28 +43534,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -44597,28 +44161,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45015,28 +44564,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45394,28 +44928,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -45771,28 +45290,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -50143,28 +49647,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -51750,28 +51239,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52183,28 +51657,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52558,28 +52017,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -52931,28 +52375,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -53876,28 +53305,13 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -54389,28 +53803,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -54765,28 +54164,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -55142,28 +54526,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -61500,28 +60869,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -63507,28 +62861,13 @@ get names(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64038,28 +63377,13 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64416,28 +63740,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -64796,28 +64105,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65171,28 +64465,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65546,28 +64825,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -65921,28 +65185,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -66296,28 +65545,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -66669,28 +65903,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -67008,28 +66227,13 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -67384,28 +66588,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -68528,28 +67717,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -69324,28 +68498,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -70177,28 +69336,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -76577,28 +75721,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -77427,28 +76556,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -83785,28 +82899,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -85205,28 +84304,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -86029,28 +85113,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -87931,28 +87000,13 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -88449,28 +87503,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -88828,28 +87867,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -90506,28 +89530,13 @@ relationships?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -90953,28 +89962,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -97311,28 +96305,13 @@ get preferredUsernames(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -98414,28 +97393,13 @@ get contents(): ((string | LanguageString))[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -98850,28 +97814,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -99225,28 +98174,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -99869,28 +98803,13 @@ get formerTypes(): ($EntityType)[] { if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -100292,28 +99211,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -100672,28 +99576,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101050,28 +99939,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101428,28 +100302,13 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { @@ -101802,28 +100661,13 @@ instruments?: (Object | URL)[];} if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 3ef38dfef..819081e80 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -265,6 +265,13 @@ export async function* generateClasses( return portableIriKeys.has(key) || ((key === "@value" || key === "@list" || key === "@set") && parentKey != null && portableIriKeys.has(parentKey)); +}\n\n`; + yield `function formatPortableIriForCache(value: string): string { + try { + return formatIri(value); + } catch { + return value; + } }\n\n`; yield `function normalizePortableIris( value: unknown, @@ -280,7 +287,7 @@ export async function* generateClasses( isPortableIriValuePosition(key, parentKey, portableIriKeys) && PORTABLE_IRI_PATTERN.test(value) ) { - return formatIri(value); + return formatPortableIriForCache(value); } return value; } @@ -338,6 +345,56 @@ export async function* generateClasses( return undefined; } return (value as Record)["@context"]; +}\n\n`; + yield `async function compactJsonLdCache( + normalized: unknown, + original: unknown, + documentLoader?: DocumentLoader, +): Promise { + if (Array.isArray(original)) { + const normalizedArray = Array.isArray(normalized) + ? normalized + : normalized != null && typeof normalized === "object" && + "@graph" in normalized && + Array.isArray((normalized as Record)["@graph"]) + ? (normalized as Record)["@graph"] as unknown[] + : undefined; + if (normalizedArray == null) return normalized; + let clone: unknown[] | undefined; + for (let i = 0; i < normalizedArray.length; i++) { + const item = await compactJsonLdCache( + normalizedArray[i], + original[i], + documentLoader, + ); + if (item !== normalizedArray[i]) { + clone ??= normalizedArray.slice(0, i); + clone.push(item); + } else if (clone != null) { + clone.push(normalizedArray[i]); + } + } + return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); + } + const context = getJsonLdContext(original); + if (context == null) return normalized; + return preserveJsonLdArrayShape( + await mergeUnmappedJsonLdTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { + documentLoader, + }, + ), + original, + context, + documentLoader, + ), + original, + ); }\n\n`; yield `function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { const terms = new Set(); diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 8e4d3ce1b..cb07e9f93 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -548,28 +548,13 @@ export async function* generateDecoder( if (cacheJsonLd != null && cacheJsonLd !== expanded) { const compactArray = Array.isArray(json) && json.length === 1; const jsonLd = compactArray ? json[0] : json; - const context = getJsonLdContext(jsonLd); const normalized = cacheJsonLd; - const cachedJsonLd = context == null - ? normalized - : preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader: options.contextLoader, - }, - ), - jsonLd, - context, - options.contextLoader, - ), - jsonLd, - ); - instance._cachedJsonLd = compactArray && context != null + const cachedJsonLd = await compactJsonLdCache( + normalized, + jsonLd, + options.contextLoader, + ); + instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null ? [cachedJsonLd] : cachedJsonLd; } else { diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index aa10f053a..9af3f7e2b 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -869,6 +869,61 @@ test("fromJsonLd() preserves compact multi-node arrays with portable IRIs", asyn ]); }); +test("fromJsonLd() preserves compact array item extension contexts with portable IRIs", async () => { + const activityJson = [ + { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + id: "https://example.com/activities/1", + actor: "https://example.com/actors/alice", + object: "https://example.com/objects/1", + }, + { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + extraRef: { + "@id": "https://example.com/ns#extraRef", + "@type": "@id", + }, + }, + ], + type: "Note", + id: "https://example.com/objects/1", + extraRef: "ap://did:key:z6Mkabc/extra", + }, + ]; + + const activity = await Activity.fromJsonLd(activityJson, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await activity.toJsonLd(), [ + { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + id: "https://example.com/activities/1", + actor: "https://example.com/actors/alice", + object: "https://example.com/objects/1", + }, + { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + extraRef: { + "@id": "https://example.com/ns#extraRef", + "@type": "@id", + }, + }, + ], + type: "Note", + id: "https://example.com/objects/1", + extraRef: "ap+ef61://did:key:z6Mkabc/extra", + }, + ]); +}); + test("fromJsonLd() formats portable IRIs in JSON-LD containers", async () => { const note = await Note.fromJsonLd({ "@context": "https://www.w3.org/ns/activitystreams", @@ -962,6 +1017,30 @@ test("fromJsonLd() preserves portable IRIs in @id extension terms", async () => deepStrictEqual(jsonLd.extraRef, "ap+ef61://did:key:z6Mkabc/extra"); }); +test("fromJsonLd() ignores malformed portable IRIs in extension cache terms", async () => { + const noteJson = { + "@context": [ + "https://www.w3.org/ns/activitystreams", + { + extraRef: { + "@id": "https://example.com/ns#extraRef", + "@type": "@id", + }, + }, + ], + type: "Note", + id: "https://example.com/notes/1", + extraRef: "ap://example.com/not-portable", + }; + + const note = await Note.fromJsonLd(noteJson, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await note.toJsonLd(), noteJson); +}); + test("fromJsonLd() preserves portable IRIs in @id typed terms", async () => { const note = await Note.fromJsonLd({ "@context": [ From 5f87005ffebe70f210ac01baf02cc326c7fe25de Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 16:06:01 +0900 Subject: [PATCH 33/55] Compare portable IRI origins Portable ActivityPub IRIs use custom URL schemes, so URL.origin is "null" even when the DID authorities differ. Compare custom-scheme IRIs by protocol and authority before trusting embedded objects, and parse fetched document URLs through parseIri() so portable bases are normalized consistently. Also accept DID method names that start with digits, matching the DID Core method-name grammar. https://github.com/fedify-dev/fedify/pull/850#discussion_r3496720566 https://github.com/fedify-dev/fedify/pull/850#discussion_r3496742107 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/mod.ts | 1 + packages/vocab-runtime/src/url.test.ts | 22 +- packages/vocab-runtime/src/url.ts | 16 +- .../src/__snapshots__/class.test.ts.deno.snap | 1434 +++++++++-------- .../src/__snapshots__/class.test.ts.node.snap | 1434 +++++++++-------- .../src/__snapshots__/class.test.ts.snap | 1434 +++++++++-------- packages/vocab-tools/src/class.ts | 1 + packages/vocab-tools/src/property.ts | 14 +- packages/vocab/src/lookup.ts | 7 +- packages/vocab/src/vocab.test.ts | 38 + 10 files changed, 2506 insertions(+), 1895 deletions(-) diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index cdb58f543..7f4cc43bd 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -53,6 +53,7 @@ export { canParseIri, expandIPv6Address, formatIri, + haveSameIriOrigin, isValidPublicIPv4Address, isValidPublicIPv6Address, parseIri, diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index d639b3513..f51047cb7 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -4,6 +4,7 @@ import { canParseIri, expandIPv6Address, formatIri, + haveSameIriOrigin, isValidPublicIPv4Address, isValidPublicIPv6Address, parseIri, @@ -42,6 +43,13 @@ test("parseIri() accepts DID schemes case-insensitively", () => { } }); +test("parseIri() accepts DID method names that start with digits", () => { + deepStrictEqual( + parseIri("ap://did:3:abc/actor"), + new URL("ap+ef61://did%3A3%3Aabc/actor"), + ); +}); + test("parseIri() preserves existing URL parsing behavior", () => { deepStrictEqual( parseIri("/actor", new URL("https://example.com/users/alice")), @@ -94,7 +102,6 @@ test("parseIri() rejects malformed portable DID authorities", () => { const cases = [ "ap://did:/actor", "ap://did:key/actor", - "ap://did:123:abc/actor", "ap://did%3Akey%3Aabc%25zz/actor", "ap://did:key:abc%25zz/actor", ]; @@ -104,6 +111,19 @@ test("parseIri() rejects malformed portable DID authorities", () => { } }); +test("haveSameIriOrigin() compares portable IRI authorities", () => { + ok(haveSameIriOrigin( + parseIri("ap://did:key:z6Mkabc/actor"), + parseIri("ap://did:key:z6Mkabc/outbox"), + )); + ok( + !haveSameIriOrigin( + parseIri("ap://did:key:z6Mkabc/actor"), + parseIri("ap://did:key:z6Mkdef/actor"), + ), + ); +}); + test("parseIri() normalizes portable URL instances", () => { deepStrictEqual( parseIri(new URL("ap+ef61://did%3Aexample%3Aabc%2Fdef/actor")), diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 058a2d3db..7ca2eafa4 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -13,8 +13,7 @@ const PORTABLE_IRI_PATTERN = /^(ap|ap\+ef61):\/\/([^/?#]*)([^?#]*)(\?[^#]*)?(#.*)?$/i; const INVALID_PERCENT_ENCODING_PATTERN = /%(?![0-9A-Fa-f]{2})/; const DID_SCHEME_PATTERN = /^did:/i; -const DID_PATTERN = - /^did:[a-z][a-z0-9]*:[A-Za-z0-9._%-]+(?::[A-Za-z0-9._%-]+)*$/i; +const DID_PATTERN = /^did:[a-z0-9]+:[A-Za-z0-9._%-]+(?::[A-Za-z0-9._%-]+)*$/i; /** * Checks whether the given string can be parsed as an IRI. @@ -60,6 +59,19 @@ export function formatIri(iri: string | URL): string { return `ap+ef61://${authority}${parsed.pathname}${parsed.search}${parsed.hash}`; } +/** + * Checks whether two IRIs have the same origin. + */ +export function haveSameIriOrigin(left: URL, right: URL): boolean { + return getComparableIriOrigin(left) === getComparableIriOrigin(right); +} + +function getComparableIriOrigin(iri: URL): string { + if (iri.origin !== "null") return iri.origin; + if (iri.host !== "") return `${iri.protocol}//${iri.host}`; + return iri.href; +} + function parsePortableIri(iri: string): URL | null { const match = iri.match(PORTABLE_IRI_PATTERN); if (match == null) return null; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 2ac99367c..478db53a2 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -17,6 +17,7 @@ import { exportSpki, formatIri, getDocumentLoader, + haveSameIriOrigin, importMultibaseKey, importPem, isDecimal, @@ -2462,14 +2463,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#attachment_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2604,7 +2605,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2645,7 +2647,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2710,14 +2712,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#attribution_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2870,7 +2872,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < 1) return null; let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2910,7 +2913,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2976,7 +2979,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3017,7 +3021,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3082,14 +3086,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#audience_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3205,7 +3209,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < 1) return null; let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3245,7 +3250,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3310,7 +3315,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3351,7 +3357,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3445,14 +3451,14 @@ get contents(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#context_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3582,7 +3588,8 @@ get contents(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3623,7 +3630,7 @@ get contents(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3730,14 +3737,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#generator_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3861,7 +3868,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3902,7 +3910,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3967,14 +3975,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#icon_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4112,7 +4120,8 @@ get names(): ((string | LanguageString))[] { if (this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < 1) return null; let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4152,7 +4161,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4218,7 +4227,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4259,7 +4269,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4324,14 +4334,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#image_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4469,7 +4479,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < 1) return null; let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4509,7 +4520,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4575,7 +4586,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4616,7 +4628,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4681,14 +4693,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replyTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4813,7 +4825,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < 1) return null; let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4853,7 +4866,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4918,7 +4931,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4959,7 +4973,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5024,14 +5038,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#location_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5156,7 +5170,8 @@ get names(): ((string | LanguageString))[] { if (this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < 1) return null; let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5196,7 +5211,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5261,7 +5276,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5302,7 +5318,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5367,14 +5383,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#preview_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5498,7 +5514,8 @@ get names(): ((string | LanguageString))[] { if (this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < 1) return null; let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5538,7 +5555,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5602,7 +5619,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5643,7 +5661,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5721,14 +5739,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replies_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5844,7 +5862,8 @@ get names(): ((string | LanguageString))[] { if (this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < 1) return null; let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5884,7 +5903,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5948,14 +5967,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#shares_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6077,7 +6096,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < 1) return null; let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6117,7 +6137,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6181,14 +6201,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likes_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6310,7 +6330,8 @@ get names(): ((string | LanguageString))[] { if (this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < 1) return null; let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6350,7 +6371,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6414,14 +6435,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#emojiReactions_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6537,7 +6558,8 @@ get names(): ((string | LanguageString))[] { if (this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < 1) return null; let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6577,7 +6599,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6681,14 +6703,14 @@ get summaries(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#tag_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6815,7 +6837,8 @@ get summaries(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6856,7 +6879,7 @@ get summaries(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6955,14 +6978,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#to_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7078,7 +7101,8 @@ get urls(): ((URL | Link))[] { if (this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < 1) return null; let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7118,7 +7142,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7183,7 +7207,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7224,7 +7249,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7289,14 +7314,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#bto_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7412,7 +7437,8 @@ get urls(): ((URL | Link))[] { if (this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < 1) return null; let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7452,7 +7478,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7517,7 +7543,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7558,7 +7585,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7623,14 +7650,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#cc_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7746,7 +7773,8 @@ get urls(): ((URL | Link))[] { if (this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < 1) return null; let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7786,7 +7814,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7851,7 +7879,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7892,7 +7921,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7957,14 +7986,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#bcc_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8080,7 +8109,8 @@ get urls(): ((URL | Link))[] { if (this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < 1) return null; let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8120,7 +8150,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8185,7 +8215,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8226,7 +8257,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8355,14 +8386,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#proof_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8477,7 +8508,8 @@ get urls(): ((URL | Link))[] { if (this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < 1) return null; let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8517,7 +8549,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8581,7 +8613,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8622,7 +8655,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8726,14 +8759,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likeAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8849,7 +8882,8 @@ get urls(): ((URL | Link))[] { if (this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < 1) return null; let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8889,7 +8923,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8953,14 +8987,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replyAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9076,7 +9110,8 @@ get urls(): ((URL | Link))[] { if (this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < 1) return null; let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9116,7 +9151,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -9180,14 +9215,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#announceAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9303,7 +9338,8 @@ get urls(): ((URL | Link))[] { if (this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < 1) return null; let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9343,7 +9379,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -13804,14 +13840,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -13928,7 +13964,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -13968,7 +14005,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14055,14 +14092,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -14178,7 +14215,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14218,7 +14256,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15427,14 +15465,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#actor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15587,7 +15625,8 @@ instruments?: (Object | URL)[];} if (this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < 1) return null; let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15627,7 +15666,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15693,7 +15732,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15734,7 +15774,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15799,14 +15839,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#object_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15923,7 +15963,8 @@ instruments?: (Object | URL)[];} if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -15963,7 +16004,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16029,7 +16070,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16070,7 +16112,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16135,14 +16177,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#target_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16262,7 +16304,8 @@ instruments?: (Object | URL)[];} if (this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < 1) return null; let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16302,7 +16345,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16371,7 +16414,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16412,7 +16456,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16477,14 +16521,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#result_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16601,7 +16645,8 @@ instruments?: (Object | URL)[];} if (this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < 1) return null; let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16641,7 +16686,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16707,7 +16752,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16748,7 +16794,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16813,14 +16859,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#origin_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16938,7 +16984,8 @@ instruments?: (Object | URL)[];} if (this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < 1) return null; let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -16978,7 +17025,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17045,7 +17092,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17086,7 +17134,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17151,14 +17199,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#instrument_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -17274,7 +17322,8 @@ instruments?: (Object | URL)[];} if (this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < 1) return null; let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17314,7 +17363,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17379,7 +17428,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17420,7 +17470,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20080,14 +20130,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20203,7 +20253,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20243,7 +20294,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20307,14 +20358,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20429,7 +20480,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20469,7 +20521,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23004,14 +23056,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23127,7 +23179,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23167,7 +23220,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23231,14 +23284,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23353,7 +23406,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23393,7 +23447,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -24424,14 +24478,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24547,7 +24601,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24587,7 +24642,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -24651,14 +24706,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24773,7 +24828,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24813,7 +24869,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -25844,14 +25900,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -25966,7 +26022,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26006,7 +26063,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26070,14 +26127,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26192,7 +26249,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26232,7 +26290,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -28232,14 +28290,14 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#verificationMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -28357,7 +28415,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < 1) return null; let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28372,7 +28431,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -29204,14 +29263,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#owner_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -29361,7 +29420,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < 1) return null; let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29401,7 +29461,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -30116,14 +30176,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#controller_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -30273,7 +30333,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < 1) return null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30313,7 +30374,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -35973,14 +36034,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36094,7 +36155,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36134,7 +36196,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36197,7 +36259,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36238,7 +36301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36303,14 +36366,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36428,7 +36491,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36468,7 +36532,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36535,7 +36599,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36576,7 +36641,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36660,14 +36725,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36803,7 +36868,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36843,7 +36909,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36907,14 +36973,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37047,7 +37113,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37087,7 +37154,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37151,14 +37218,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37277,7 +37344,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37317,7 +37385,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37381,14 +37449,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37510,7 +37578,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37550,7 +37619,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37614,14 +37683,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37741,7 +37810,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37781,7 +37851,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37845,14 +37915,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37970,7 +38040,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38010,7 +38081,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38074,14 +38145,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38199,7 +38270,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38239,7 +38311,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38303,14 +38375,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38425,7 +38497,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38466,7 +38539,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38606,14 +38679,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38763,7 +38836,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38803,7 +38877,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38867,14 +38941,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39028,7 +39102,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39068,7 +39143,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39135,7 +39210,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39176,7 +39252,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39241,14 +39317,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39366,7 +39442,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39406,7 +39483,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39473,7 +39550,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39514,7 +39592,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -42675,14 +42753,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -42799,7 +42877,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42839,7 +42918,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -42926,14 +43005,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -43049,7 +43128,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43089,7 +43169,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -45882,14 +45962,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#current_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46005,7 +46085,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < 1) return null; let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46045,7 +46126,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46109,14 +46190,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#first_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46232,7 +46313,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < 1) return null; let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46272,7 +46354,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46336,14 +46418,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#last_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46459,7 +46541,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < 1) return null; let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46499,7 +46582,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46563,14 +46646,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46695,7 +46778,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46736,7 +46820,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46801,14 +46885,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46923,7 +47007,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < 1) return null; let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -46963,7 +47048,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47027,14 +47112,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#sharesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47149,7 +47234,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < 1) return null; let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47189,7 +47275,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47253,14 +47339,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#repliesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47375,7 +47461,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < 1) return null; let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47415,7 +47502,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47479,14 +47566,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inboxOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47601,7 +47688,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < 1) return null; let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47641,7 +47729,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47705,14 +47793,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outboxOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47827,7 +47915,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < 1) return null; let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47867,7 +47956,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47931,14 +48020,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followersOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48053,7 +48142,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < 1) return null; let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48093,7 +48183,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48157,14 +48247,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followingOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48279,7 +48369,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < 1) return null; let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48319,7 +48410,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48383,14 +48474,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likedOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48505,7 +48596,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < 1) return null; let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48545,7 +48637,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50182,14 +50274,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#partOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50305,7 +50397,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < 1) return null; let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50345,7 +50438,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50409,14 +50502,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#next_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50530,7 +50623,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < 1) return null; let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50570,7 +50664,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50634,14 +50728,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#prev_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50756,7 +50850,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < 1) return null; let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50796,7 +50891,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55641,14 +55736,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -55762,7 +55857,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55802,7 +55898,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55865,7 +55961,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55906,7 +56003,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55971,14 +56068,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56096,7 +56193,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56136,7 +56234,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56203,7 +56301,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56244,7 +56343,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56328,14 +56427,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56471,7 +56570,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56511,7 +56611,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56575,14 +56675,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56715,7 +56815,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56755,7 +56856,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56819,14 +56920,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56945,7 +57046,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -56985,7 +57087,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57049,14 +57151,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57178,7 +57280,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57218,7 +57321,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57282,14 +57385,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57409,7 +57512,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57449,7 +57553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57513,14 +57617,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57638,7 +57742,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57678,7 +57783,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57742,14 +57847,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57867,7 +57972,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57907,7 +58013,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57971,14 +58077,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58093,7 +58199,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58134,7 +58241,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58274,14 +58381,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58431,7 +58538,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58471,7 +58579,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58535,14 +58643,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58696,7 +58804,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58736,7 +58845,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58803,7 +58912,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58844,7 +58954,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58909,14 +59019,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -59034,7 +59144,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59074,7 +59185,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -59141,7 +59252,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59182,7 +59294,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -62024,14 +62136,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#preview_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -62154,7 +62266,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62195,7 +62308,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -66858,14 +66971,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -66982,7 +67095,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67022,7 +67136,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67109,14 +67223,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -67232,7 +67346,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67272,7 +67387,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -68004,14 +68119,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68136,7 +68251,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68177,7 +68293,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -68775,14 +68891,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68907,7 +69023,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68948,7 +69065,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70493,14 +70610,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70614,7 +70731,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70654,7 +70772,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70717,7 +70835,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70758,7 +70877,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70823,14 +70942,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70948,7 +71067,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70988,7 +71108,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71055,7 +71175,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71096,7 +71217,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71180,14 +71301,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71323,7 +71444,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71363,7 +71485,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71427,14 +71549,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71567,7 +71689,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71607,7 +71730,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71671,14 +71794,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71797,7 +71920,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71837,7 +71961,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71901,14 +72025,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72030,7 +72154,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72070,7 +72195,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72134,14 +72259,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72261,7 +72386,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72301,7 +72427,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72365,14 +72491,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72490,7 +72616,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72530,7 +72657,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72594,14 +72721,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72719,7 +72846,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72759,7 +72887,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72823,14 +72951,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72945,7 +73073,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -72986,7 +73115,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73126,14 +73255,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73283,7 +73412,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73323,7 +73453,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73387,14 +73517,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73548,7 +73678,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73588,7 +73719,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73655,7 +73786,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73696,7 +73828,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73761,14 +73893,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73886,7 +74018,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73926,7 +74059,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73993,7 +74126,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74034,7 +74168,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -77671,14 +77805,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -77792,7 +77926,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77832,7 +77967,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -77895,7 +78030,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -77936,7 +78072,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78001,14 +78137,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78126,7 +78262,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78166,7 +78303,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78233,7 +78370,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78274,7 +78412,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78358,14 +78496,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78501,7 +78639,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78541,7 +78680,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78605,14 +78744,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78745,7 +78884,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78785,7 +78925,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78849,14 +78989,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78975,7 +79115,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79015,7 +79156,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79079,14 +79220,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79208,7 +79349,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79248,7 +79390,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79312,14 +79454,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79439,7 +79581,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79479,7 +79622,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79543,14 +79686,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79668,7 +79811,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79708,7 +79852,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79772,14 +79916,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79897,7 +80041,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -79937,7 +80082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80001,14 +80146,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80123,7 +80268,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80164,7 +80310,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80304,14 +80450,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80461,7 +80607,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80501,7 +80648,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80565,14 +80712,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80726,7 +80873,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80766,7 +80914,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80833,7 +80981,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -80874,7 +81023,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80939,14 +81088,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -81064,7 +81213,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81104,7 +81254,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -81171,7 +81321,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81212,7 +81363,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -84641,14 +84792,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#describes_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -84764,7 +84915,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < 1) return null; let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84804,7 +84956,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85559,14 +85711,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#exclusiveOption_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85683,7 +85835,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85724,7 +85877,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85789,14 +85942,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inclusiveOption_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85913,7 +86066,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -85954,7 +86108,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86049,14 +86203,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86173,7 +86327,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86213,7 +86368,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86300,14 +86455,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86423,7 +86578,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86463,7 +86619,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88258,14 +88414,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#subject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88383,7 +88539,8 @@ relationships?: (Object | URL)[];} if (this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < 1) return null; let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88423,7 +88580,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88487,14 +88644,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#object_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88609,7 +88766,8 @@ relationships?: (Object | URL)[];} if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88649,7 +88807,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88713,7 +88871,8 @@ relationships?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88754,7 +88913,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88819,14 +88978,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#relationship_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88943,7 +89102,8 @@ relationships?: (Object | URL)[];} if (this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < 1) return null; let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -88983,7 +89143,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89049,7 +89209,8 @@ relationships?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89090,7 +89251,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91077,14 +91238,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91198,7 +91359,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91238,7 +91400,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91301,7 +91463,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91342,7 +91505,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91407,14 +91570,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91532,7 +91695,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91572,7 +91736,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91639,7 +91803,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91680,7 +91845,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91764,14 +91929,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91907,7 +92072,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -91947,7 +92113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92011,14 +92177,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92151,7 +92317,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92191,7 +92358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92255,14 +92422,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92381,7 +92548,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92421,7 +92589,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92485,14 +92653,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92614,7 +92782,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92654,7 +92823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92718,14 +92887,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92845,7 +93014,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -92885,7 +93055,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92949,14 +93119,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93074,7 +93244,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93114,7 +93285,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93178,14 +93349,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93303,7 +93474,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93343,7 +93515,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93407,14 +93579,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93529,7 +93701,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93570,7 +93743,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93710,14 +93883,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93867,7 +94040,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -93907,7 +94081,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93971,14 +94145,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94132,7 +94306,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94172,7 +94347,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94239,7 +94414,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94280,7 +94456,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94345,14 +94521,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94470,7 +94646,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94510,7 +94687,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94577,7 +94754,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94618,7 +94796,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 5b111aa53..4106b7634 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -15,6 +15,7 @@ import { exportSpki, formatIri, getDocumentLoader, + haveSameIriOrigin, importMultibaseKey, importPem, isDecimal, @@ -2460,14 +2461,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#attachment_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2602,7 +2603,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2643,7 +2645,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2708,14 +2710,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#attribution_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2868,7 +2870,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < 1) return null; let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2908,7 +2911,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2974,7 +2977,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3015,7 +3019,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3080,14 +3084,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#audience_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3203,7 +3207,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < 1) return null; let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3243,7 +3248,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3308,7 +3313,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3349,7 +3355,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3443,14 +3449,14 @@ get contents(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#context_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3580,7 +3586,8 @@ get contents(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3621,7 +3628,7 @@ get contents(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3728,14 +3735,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#generator_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3859,7 +3866,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3900,7 +3908,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3965,14 +3973,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#icon_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4110,7 +4118,8 @@ get names(): ((string | LanguageString))[] { if (this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < 1) return null; let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4150,7 +4159,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4216,7 +4225,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4257,7 +4267,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4322,14 +4332,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#image_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4467,7 +4477,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < 1) return null; let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4507,7 +4518,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4573,7 +4584,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4614,7 +4626,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4679,14 +4691,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replyTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4811,7 +4823,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < 1) return null; let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4851,7 +4864,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4916,7 +4929,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4957,7 +4971,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5022,14 +5036,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#location_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5154,7 +5168,8 @@ get names(): ((string | LanguageString))[] { if (this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < 1) return null; let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5194,7 +5209,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5259,7 +5274,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5300,7 +5316,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5365,14 +5381,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#preview_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5496,7 +5512,8 @@ get names(): ((string | LanguageString))[] { if (this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < 1) return null; let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5536,7 +5553,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5600,7 +5617,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5641,7 +5659,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5719,14 +5737,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replies_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5842,7 +5860,8 @@ get names(): ((string | LanguageString))[] { if (this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < 1) return null; let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5882,7 +5901,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5946,14 +5965,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#shares_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6075,7 +6094,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < 1) return null; let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6115,7 +6135,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6179,14 +6199,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likes_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6308,7 +6328,8 @@ get names(): ((string | LanguageString))[] { if (this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < 1) return null; let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6348,7 +6369,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6412,14 +6433,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#emojiReactions_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6535,7 +6556,8 @@ get names(): ((string | LanguageString))[] { if (this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < 1) return null; let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6575,7 +6597,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6679,14 +6701,14 @@ get summaries(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#tag_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6813,7 +6835,8 @@ get summaries(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6854,7 +6877,7 @@ get summaries(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6953,14 +6976,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#to_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7076,7 +7099,8 @@ get urls(): ((URL | Link))[] { if (this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < 1) return null; let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7116,7 +7140,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7181,7 +7205,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7222,7 +7247,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7287,14 +7312,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#bto_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7410,7 +7435,8 @@ get urls(): ((URL | Link))[] { if (this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < 1) return null; let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7450,7 +7476,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7515,7 +7541,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7556,7 +7583,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7621,14 +7648,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#cc_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7744,7 +7771,8 @@ get urls(): ((URL | Link))[] { if (this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < 1) return null; let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7784,7 +7812,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7849,7 +7877,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7890,7 +7919,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7955,14 +7984,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#bcc_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8078,7 +8107,8 @@ get urls(): ((URL | Link))[] { if (this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < 1) return null; let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8118,7 +8148,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8183,7 +8213,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8224,7 +8255,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8353,14 +8384,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#proof_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8475,7 +8506,8 @@ get urls(): ((URL | Link))[] { if (this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < 1) return null; let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8515,7 +8547,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8579,7 +8611,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8620,7 +8653,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8724,14 +8757,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likeAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8847,7 +8880,8 @@ get urls(): ((URL | Link))[] { if (this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < 1) return null; let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8887,7 +8921,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8951,14 +8985,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replyAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9074,7 +9108,8 @@ get urls(): ((URL | Link))[] { if (this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < 1) return null; let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9114,7 +9149,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -9178,14 +9213,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#announceAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9301,7 +9336,8 @@ get urls(): ((URL | Link))[] { if (this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < 1) return null; let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9341,7 +9377,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -13802,14 +13838,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -13926,7 +13962,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -13966,7 +14003,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14053,14 +14090,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -14176,7 +14213,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14216,7 +14254,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15425,14 +15463,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#actor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15585,7 +15623,8 @@ instruments?: (Object | URL)[];} if (this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < 1) return null; let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15625,7 +15664,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15691,7 +15730,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15732,7 +15772,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15797,14 +15837,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#object_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15921,7 +15961,8 @@ instruments?: (Object | URL)[];} if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -15961,7 +16002,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16027,7 +16068,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16068,7 +16110,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16133,14 +16175,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#target_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16260,7 +16302,8 @@ instruments?: (Object | URL)[];} if (this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < 1) return null; let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16300,7 +16343,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16369,7 +16412,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16410,7 +16454,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16475,14 +16519,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#result_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16599,7 +16643,8 @@ instruments?: (Object | URL)[];} if (this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < 1) return null; let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16639,7 +16684,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16705,7 +16750,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16746,7 +16792,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16811,14 +16857,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#origin_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16936,7 +16982,8 @@ instruments?: (Object | URL)[];} if (this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < 1) return null; let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -16976,7 +17023,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17043,7 +17090,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17084,7 +17132,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17149,14 +17197,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#instrument_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -17272,7 +17320,8 @@ instruments?: (Object | URL)[];} if (this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < 1) return null; let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17312,7 +17361,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17377,7 +17426,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17418,7 +17468,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20078,14 +20128,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20201,7 +20251,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20241,7 +20292,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20305,14 +20356,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20427,7 +20478,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20467,7 +20519,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23002,14 +23054,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23125,7 +23177,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23165,7 +23218,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23229,14 +23282,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23351,7 +23404,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23391,7 +23445,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -24422,14 +24476,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24545,7 +24599,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24585,7 +24640,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -24649,14 +24704,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24771,7 +24826,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24811,7 +24867,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -25842,14 +25898,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -25964,7 +26020,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26004,7 +26061,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26068,14 +26125,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26190,7 +26247,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26230,7 +26288,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -28230,14 +28288,14 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#verificationMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -28355,7 +28413,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < 1) return null; let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28370,7 +28429,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -29202,14 +29261,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#owner_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -29359,7 +29418,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < 1) return null; let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29399,7 +29459,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -30114,14 +30174,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#controller_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -30271,7 +30331,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < 1) return null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30311,7 +30372,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -35971,14 +36032,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36092,7 +36153,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36132,7 +36194,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36195,7 +36257,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36236,7 +36299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36301,14 +36364,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36426,7 +36489,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36466,7 +36530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36533,7 +36597,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36574,7 +36639,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36658,14 +36723,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36801,7 +36866,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36841,7 +36907,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36905,14 +36971,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37045,7 +37111,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37085,7 +37152,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37149,14 +37216,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37275,7 +37342,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37315,7 +37383,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37379,14 +37447,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37508,7 +37576,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37548,7 +37617,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37612,14 +37681,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37739,7 +37808,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37779,7 +37849,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37843,14 +37913,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37968,7 +38038,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38008,7 +38079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38072,14 +38143,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38197,7 +38268,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38237,7 +38309,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38301,14 +38373,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38423,7 +38495,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38464,7 +38537,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38604,14 +38677,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38761,7 +38834,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38801,7 +38875,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38865,14 +38939,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39026,7 +39100,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39066,7 +39141,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39133,7 +39208,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39174,7 +39250,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39239,14 +39315,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39364,7 +39440,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39404,7 +39481,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39471,7 +39548,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39512,7 +39590,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -42673,14 +42751,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -42797,7 +42875,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42837,7 +42916,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -42924,14 +43003,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -43047,7 +43126,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43087,7 +43167,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -45880,14 +45960,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#current_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46003,7 +46083,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < 1) return null; let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46043,7 +46124,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46107,14 +46188,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#first_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46230,7 +46311,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < 1) return null; let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46270,7 +46352,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46334,14 +46416,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#last_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46457,7 +46539,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < 1) return null; let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46497,7 +46580,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46561,14 +46644,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46693,7 +46776,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46734,7 +46818,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46799,14 +46883,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46921,7 +47005,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < 1) return null; let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -46961,7 +47046,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47025,14 +47110,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#sharesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47147,7 +47232,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < 1) return null; let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47187,7 +47273,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47251,14 +47337,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#repliesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47373,7 +47459,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < 1) return null; let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47413,7 +47500,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47477,14 +47564,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inboxOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47599,7 +47686,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < 1) return null; let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47639,7 +47727,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47703,14 +47791,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outboxOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47825,7 +47913,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < 1) return null; let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47865,7 +47954,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47929,14 +48018,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followersOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48051,7 +48140,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < 1) return null; let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48091,7 +48181,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48155,14 +48245,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followingOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48277,7 +48367,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < 1) return null; let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48317,7 +48408,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48381,14 +48472,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likedOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48503,7 +48594,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < 1) return null; let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48543,7 +48635,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50180,14 +50272,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#partOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50303,7 +50395,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < 1) return null; let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50343,7 +50436,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50407,14 +50500,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#next_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50528,7 +50621,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < 1) return null; let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50568,7 +50662,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50632,14 +50726,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#prev_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50754,7 +50848,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < 1) return null; let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50794,7 +50889,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55639,14 +55734,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -55760,7 +55855,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55800,7 +55896,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55863,7 +55959,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55904,7 +56001,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55969,14 +56066,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56094,7 +56191,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56134,7 +56232,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56201,7 +56299,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56242,7 +56341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56326,14 +56425,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56469,7 +56568,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56509,7 +56609,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56573,14 +56673,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56713,7 +56813,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56753,7 +56854,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56817,14 +56918,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56943,7 +57044,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -56983,7 +57085,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57047,14 +57149,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57176,7 +57278,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57216,7 +57319,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57280,14 +57383,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57407,7 +57510,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57447,7 +57551,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57511,14 +57615,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57636,7 +57740,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57676,7 +57781,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57740,14 +57845,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57865,7 +57970,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57905,7 +58011,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57969,14 +58075,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58091,7 +58197,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58132,7 +58239,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58272,14 +58379,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58429,7 +58536,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58469,7 +58577,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58533,14 +58641,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58694,7 +58802,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58734,7 +58843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58801,7 +58910,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58842,7 +58952,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58907,14 +59017,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -59032,7 +59142,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59072,7 +59183,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -59139,7 +59250,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59180,7 +59292,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -62022,14 +62134,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#preview_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -62152,7 +62264,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62193,7 +62306,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -66856,14 +66969,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -66980,7 +67093,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67020,7 +67134,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67107,14 +67221,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -67230,7 +67344,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67270,7 +67385,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -68002,14 +68117,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68134,7 +68249,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68175,7 +68291,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -68773,14 +68889,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68905,7 +69021,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68946,7 +69063,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70491,14 +70608,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70612,7 +70729,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70652,7 +70770,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70715,7 +70833,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70756,7 +70875,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70821,14 +70940,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70946,7 +71065,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70986,7 +71106,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71053,7 +71173,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71094,7 +71215,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71178,14 +71299,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71321,7 +71442,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71361,7 +71483,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71425,14 +71547,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71565,7 +71687,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71605,7 +71728,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71669,14 +71792,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71795,7 +71918,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71835,7 +71959,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71899,14 +72023,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72028,7 +72152,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72068,7 +72193,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72132,14 +72257,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72259,7 +72384,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72299,7 +72425,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72363,14 +72489,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72488,7 +72614,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72528,7 +72655,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72592,14 +72719,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72717,7 +72844,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72757,7 +72885,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72821,14 +72949,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72943,7 +73071,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -72984,7 +73113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73124,14 +73253,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73281,7 +73410,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73321,7 +73451,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73385,14 +73515,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73546,7 +73676,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73586,7 +73717,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73653,7 +73784,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73694,7 +73826,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73759,14 +73891,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73884,7 +74016,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73924,7 +74057,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73991,7 +74124,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74032,7 +74166,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -77669,14 +77803,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -77790,7 +77924,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77830,7 +77965,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -77893,7 +78028,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -77934,7 +78070,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -77999,14 +78135,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78124,7 +78260,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78164,7 +78301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78231,7 +78368,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78272,7 +78410,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78356,14 +78494,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78499,7 +78637,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78539,7 +78678,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78603,14 +78742,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78743,7 +78882,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78783,7 +78923,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78847,14 +78987,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78973,7 +79113,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79013,7 +79154,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79077,14 +79218,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79206,7 +79347,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79246,7 +79388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79310,14 +79452,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79437,7 +79579,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79477,7 +79620,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79541,14 +79684,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79666,7 +79809,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79706,7 +79850,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79770,14 +79914,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79895,7 +80039,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -79935,7 +80080,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79999,14 +80144,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80121,7 +80266,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80162,7 +80308,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80302,14 +80448,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80459,7 +80605,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80499,7 +80646,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80563,14 +80710,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80724,7 +80871,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80764,7 +80912,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80831,7 +80979,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -80872,7 +81021,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80937,14 +81086,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -81062,7 +81211,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81102,7 +81252,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -81169,7 +81319,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81210,7 +81361,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -84639,14 +84790,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#describes_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -84762,7 +84913,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < 1) return null; let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84802,7 +84954,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85557,14 +85709,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#exclusiveOption_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85681,7 +85833,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85722,7 +85875,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85787,14 +85940,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inclusiveOption_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85911,7 +86064,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -85952,7 +86106,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86047,14 +86201,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86171,7 +86325,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86211,7 +86366,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86298,14 +86453,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86421,7 +86576,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86461,7 +86617,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88256,14 +88412,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#subject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88381,7 +88537,8 @@ relationships?: (Object | URL)[];} if (this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < 1) return null; let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88421,7 +88578,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88485,14 +88642,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#object_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88607,7 +88764,8 @@ relationships?: (Object | URL)[];} if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88647,7 +88805,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88711,7 +88869,8 @@ relationships?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88752,7 +88911,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88817,14 +88976,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#relationship_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88941,7 +89100,8 @@ relationships?: (Object | URL)[];} if (this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < 1) return null; let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -88981,7 +89141,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89047,7 +89207,8 @@ relationships?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89088,7 +89249,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91075,14 +91236,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91196,7 +91357,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91236,7 +91398,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91299,7 +91461,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91340,7 +91503,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91405,14 +91568,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91530,7 +91693,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91570,7 +91734,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91637,7 +91801,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91678,7 +91843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91762,14 +91927,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91905,7 +92070,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -91945,7 +92111,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92009,14 +92175,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92149,7 +92315,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92189,7 +92356,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92253,14 +92420,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92379,7 +92546,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92419,7 +92587,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92483,14 +92651,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92612,7 +92780,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92652,7 +92821,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92716,14 +92885,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92843,7 +93012,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -92883,7 +93053,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92947,14 +93117,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93072,7 +93242,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93112,7 +93283,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93176,14 +93347,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93301,7 +93472,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93341,7 +93513,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93405,14 +93577,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93527,7 +93699,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93568,7 +93741,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93708,14 +93881,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93865,7 +94038,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -93905,7 +94079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93969,14 +94143,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94130,7 +94304,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94170,7 +94345,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94237,7 +94412,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94278,7 +94454,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94343,14 +94519,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94468,7 +94644,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94508,7 +94685,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94575,7 +94752,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94616,7 +94794,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 0f978751d..2492c91df 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -17,6 +17,7 @@ import { exportSpki, formatIri, getDocumentLoader, + haveSameIriOrigin, importMultibaseKey, importPem, isDecimal, @@ -2462,14 +2463,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#attachment_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -2604,7 +2605,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2645,7 +2647,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -2710,14 +2712,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#attribution_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -2870,7 +2872,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < 1) return null; let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2910,7 +2913,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -2976,7 +2979,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3017,7 +3021,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3082,14 +3086,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#audience_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3205,7 +3209,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < 1) return null; let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3245,7 +3250,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3310,7 +3315,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3351,7 +3357,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3445,14 +3451,14 @@ get contents(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#context_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3582,7 +3588,8 @@ get contents(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3623,7 +3630,7 @@ get contents(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3730,14 +3737,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#generator_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3861,7 +3868,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3902,7 +3910,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3967,14 +3975,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#icon_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4112,7 +4120,8 @@ get names(): ((string | LanguageString))[] { if (this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < 1) return null; let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4152,7 +4161,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4218,7 +4227,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4259,7 +4269,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4324,14 +4334,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#image_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4469,7 +4479,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < 1) return null; let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4509,7 +4520,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4575,7 +4586,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4616,7 +4628,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4681,14 +4693,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replyTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4813,7 +4825,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < 1) return null; let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4853,7 +4866,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4918,7 +4931,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4959,7 +4973,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5024,14 +5038,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#location_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5156,7 +5170,8 @@ get names(): ((string | LanguageString))[] { if (this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < 1) return null; let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5196,7 +5211,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5261,7 +5276,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5302,7 +5318,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5367,14 +5383,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#preview_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5498,7 +5514,8 @@ get names(): ((string | LanguageString))[] { if (this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < 1) return null; let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5538,7 +5555,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5602,7 +5619,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5643,7 +5661,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5721,14 +5739,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replies_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5844,7 +5862,8 @@ get names(): ((string | LanguageString))[] { if (this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < 1) return null; let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5884,7 +5903,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5948,14 +5967,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#shares_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6077,7 +6096,8 @@ get names(): ((string | LanguageString))[] { if (this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < 1) return null; let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6117,7 +6137,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6181,14 +6201,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likes_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6310,7 +6330,8 @@ get names(): ((string | LanguageString))[] { if (this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < 1) return null; let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6350,7 +6371,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6414,14 +6435,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#emojiReactions_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6537,7 +6558,8 @@ get names(): ((string | LanguageString))[] { if (this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < 1) return null; let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6577,7 +6599,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6681,14 +6703,14 @@ get summaries(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#tag_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6815,7 +6837,8 @@ get summaries(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6856,7 +6879,7 @@ get summaries(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6955,14 +6978,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#to_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7078,7 +7101,8 @@ get urls(): ((URL | Link))[] { if (this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < 1) return null; let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7118,7 +7142,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7183,7 +7207,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7224,7 +7249,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7289,14 +7314,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#bto_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7412,7 +7437,8 @@ get urls(): ((URL | Link))[] { if (this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < 1) return null; let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7452,7 +7478,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7517,7 +7543,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7558,7 +7585,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7623,14 +7650,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#cc_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7746,7 +7773,8 @@ get urls(): ((URL | Link))[] { if (this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < 1) return null; let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7786,7 +7814,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7851,7 +7879,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7892,7 +7921,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7957,14 +7986,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#bcc_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8080,7 +8109,8 @@ get urls(): ((URL | Link))[] { if (this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < 1) return null; let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8120,7 +8150,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8185,7 +8215,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8226,7 +8257,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8355,14 +8386,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#proof_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8477,7 +8508,8 @@ get urls(): ((URL | Link))[] { if (this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < 1) return null; let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8517,7 +8549,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8581,7 +8613,8 @@ get urls(): ((URL | Link))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8622,7 +8655,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8726,14 +8759,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likeAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8849,7 +8882,8 @@ get urls(): ((URL | Link))[] { if (this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < 1) return null; let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8889,7 +8923,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8953,14 +8987,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#replyAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -9076,7 +9110,8 @@ get urls(): ((URL | Link))[] { if (this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < 1) return null; let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9116,7 +9151,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -9180,14 +9215,14 @@ get urls(): ((URL | Link))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#announceAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -9303,7 +9338,8 @@ get urls(): ((URL | Link))[] { if (this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < 1) return null; let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9343,7 +9379,7 @@ get urls(): ((URL | Link))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -13804,14 +13840,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -13928,7 +13964,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -13968,7 +14005,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -14055,14 +14092,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -14178,7 +14215,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14218,7 +14256,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -15427,14 +15465,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#actor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -15587,7 +15625,8 @@ instruments?: (Object | URL)[];} if (this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < 1) return null; let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15627,7 +15666,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -15693,7 +15732,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15734,7 +15774,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -15799,14 +15839,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#object_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -15923,7 +15963,8 @@ instruments?: (Object | URL)[];} if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -15963,7 +16004,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16029,7 +16070,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16070,7 +16112,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16135,14 +16177,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#target_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16262,7 +16304,8 @@ instruments?: (Object | URL)[];} if (this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < 1) return null; let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16302,7 +16345,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16371,7 +16414,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16412,7 +16456,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16477,14 +16521,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#result_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16601,7 +16645,8 @@ instruments?: (Object | URL)[];} if (this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < 1) return null; let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16641,7 +16686,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16707,7 +16752,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16748,7 +16794,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16813,14 +16859,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#origin_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16938,7 +16984,8 @@ instruments?: (Object | URL)[];} if (this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < 1) return null; let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -16978,7 +17025,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17045,7 +17092,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17086,7 +17134,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17151,14 +17199,14 @@ instruments?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#instrument_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -17274,7 +17322,8 @@ instruments?: (Object | URL)[];} if (this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < 1) return null; let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17314,7 +17363,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17379,7 +17428,8 @@ instruments?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17420,7 +17470,7 @@ instruments?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -20080,14 +20130,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -20203,7 +20253,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20243,7 +20294,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -20307,14 +20358,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -20429,7 +20480,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20469,7 +20521,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -23004,14 +23056,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -23127,7 +23179,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23167,7 +23220,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -23231,14 +23284,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -23353,7 +23406,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23393,7 +23447,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -24424,14 +24478,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -24547,7 +24601,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24587,7 +24642,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -24651,14 +24706,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -24773,7 +24828,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24813,7 +24869,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -25844,14 +25900,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactingObject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -25966,7 +26022,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26006,7 +26063,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -26070,14 +26127,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#interactionTarget_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -26192,7 +26249,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26232,7 +26290,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -28232,14 +28290,14 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#verificationMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -28357,7 +28415,8 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < 1) return null; let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28372,7 +28431,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -29204,14 +29263,14 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#owner_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -29361,7 +29420,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < 1) return null; let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29401,7 +29461,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -30116,14 +30176,14 @@ controller?: Application | Group | Organization | Person | Service | URL | null; throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#controller_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -30273,7 +30333,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < 1) return null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30313,7 +30374,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -35973,14 +36034,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36094,7 +36155,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36134,7 +36196,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36197,7 +36259,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36238,7 +36301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36303,14 +36366,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36428,7 +36491,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36468,7 +36532,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36535,7 +36599,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36576,7 +36641,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36660,14 +36725,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36803,7 +36868,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36843,7 +36909,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36907,14 +36973,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37047,7 +37113,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37087,7 +37154,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37151,14 +37218,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37277,7 +37344,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37317,7 +37385,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37381,14 +37449,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37510,7 +37578,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37550,7 +37619,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37614,14 +37683,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37741,7 +37810,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37781,7 +37851,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37845,14 +37915,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37970,7 +38040,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38010,7 +38081,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38074,14 +38145,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38199,7 +38270,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38239,7 +38311,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38303,14 +38375,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38425,7 +38497,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38466,7 +38539,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38606,14 +38679,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38763,7 +38836,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38803,7 +38877,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38867,14 +38941,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -39028,7 +39102,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39068,7 +39143,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39135,7 +39210,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39176,7 +39252,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39241,14 +39317,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -39366,7 +39442,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39406,7 +39483,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39473,7 +39550,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39514,7 +39592,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -42675,14 +42753,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -42799,7 +42877,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42839,7 +42918,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -42926,14 +43005,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -43049,7 +43128,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43089,7 +43169,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -45882,14 +45962,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#current_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46005,7 +46085,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < 1) return null; let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46045,7 +46126,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46109,14 +46190,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#first_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46232,7 +46313,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < 1) return null; let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46272,7 +46354,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46336,14 +46418,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#last_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46459,7 +46541,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < 1) return null; let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46499,7 +46582,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46563,14 +46646,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46695,7 +46778,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46736,7 +46820,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46801,14 +46885,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46923,7 +47007,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < 1) return null; let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -46963,7 +47048,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47027,14 +47112,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#sharesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47149,7 +47234,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < 1) return null; let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47189,7 +47275,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47253,14 +47339,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#repliesOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47375,7 +47461,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < 1) return null; let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47415,7 +47502,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47479,14 +47566,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inboxOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47601,7 +47688,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < 1) return null; let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47641,7 +47729,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47705,14 +47793,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outboxOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47827,7 +47915,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < 1) return null; let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47867,7 +47956,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47931,14 +48020,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followersOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48053,7 +48142,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < 1) return null; let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48093,7 +48183,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -48157,14 +48247,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followingOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48279,7 +48369,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < 1) return null; let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48319,7 +48410,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -48383,14 +48474,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#likedOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48505,7 +48596,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < 1) return null; let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48545,7 +48637,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -50182,14 +50274,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#partOf_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50305,7 +50397,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < 1) return null; let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50345,7 +50438,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -50409,14 +50502,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#next_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50530,7 +50623,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < 1) return null; let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50570,7 +50664,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -50634,14 +50728,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#prev_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50756,7 +50850,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < 1) return null; let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50796,7 +50891,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -55641,14 +55736,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -55762,7 +55857,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55802,7 +55898,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -55865,7 +55961,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55906,7 +56003,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -55971,14 +56068,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56096,7 +56193,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56136,7 +56234,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56203,7 +56301,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56244,7 +56343,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56328,14 +56427,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56471,7 +56570,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56511,7 +56611,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56575,14 +56675,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56715,7 +56815,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56755,7 +56856,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56819,14 +56920,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56945,7 +57046,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -56985,7 +57087,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57049,14 +57151,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57178,7 +57280,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57218,7 +57321,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57282,14 +57385,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57409,7 +57512,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57449,7 +57553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57513,14 +57617,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57638,7 +57742,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57678,7 +57783,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57742,14 +57847,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57867,7 +57972,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57907,7 +58013,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57971,14 +58077,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58093,7 +58199,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58134,7 +58241,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58274,14 +58381,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58431,7 +58538,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58471,7 +58579,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58535,14 +58643,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58696,7 +58804,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58736,7 +58845,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58803,7 +58912,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58844,7 +58954,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58909,14 +59019,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -59034,7 +59144,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59074,7 +59185,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -59141,7 +59252,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59182,7 +59294,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -62024,14 +62136,14 @@ get names(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#preview_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -62154,7 +62266,8 @@ get names(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62195,7 +62308,7 @@ get names(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -66858,14 +66971,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -66982,7 +67095,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67022,7 +67136,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -67109,14 +67223,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -67232,7 +67346,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67272,7 +67387,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -68004,14 +68119,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -68136,7 +68251,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68177,7 +68293,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -68775,14 +68891,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#item_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -68907,7 +69023,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68948,7 +69065,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -70493,14 +70610,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -70614,7 +70731,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70654,7 +70772,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -70717,7 +70835,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70758,7 +70877,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -70823,14 +70942,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -70948,7 +71067,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70988,7 +71108,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71055,7 +71175,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71096,7 +71217,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71180,14 +71301,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71323,7 +71444,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71363,7 +71485,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71427,14 +71549,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71567,7 +71689,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71607,7 +71730,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71671,14 +71794,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71797,7 +71920,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71837,7 +71961,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71901,14 +72025,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72030,7 +72154,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72070,7 +72195,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72134,14 +72259,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72261,7 +72386,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72301,7 +72427,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72365,14 +72491,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72490,7 +72616,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72530,7 +72657,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72594,14 +72721,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72719,7 +72846,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72759,7 +72887,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72823,14 +72951,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72945,7 +73073,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -72986,7 +73115,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73126,14 +73255,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73283,7 +73412,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73323,7 +73453,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73387,14 +73517,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73548,7 +73678,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73588,7 +73719,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73655,7 +73786,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73696,7 +73828,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73761,14 +73893,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73886,7 +74018,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73926,7 +74059,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73993,7 +74126,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74034,7 +74168,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -77671,14 +77805,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -77792,7 +77926,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77832,7 +77967,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -77895,7 +78030,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -77936,7 +78072,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78001,14 +78137,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78126,7 +78262,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78166,7 +78303,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78233,7 +78370,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78274,7 +78412,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78358,14 +78496,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78501,7 +78639,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78541,7 +78680,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78605,14 +78744,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78745,7 +78884,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78785,7 +78925,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78849,14 +78989,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78975,7 +79115,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79015,7 +79156,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79079,14 +79220,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79208,7 +79349,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79248,7 +79390,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79312,14 +79454,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79439,7 +79581,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79479,7 +79622,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79543,14 +79686,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79668,7 +79811,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79708,7 +79852,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79772,14 +79916,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79897,7 +80041,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -79937,7 +80082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80001,14 +80146,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80123,7 +80268,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80164,7 +80310,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80304,14 +80450,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80461,7 +80607,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80501,7 +80648,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80565,14 +80712,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80726,7 +80873,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80766,7 +80914,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80833,7 +80981,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -80874,7 +81023,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80939,14 +81088,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -81064,7 +81213,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81104,7 +81254,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -81171,7 +81321,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81212,7 +81363,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -84641,14 +84792,14 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#describes_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -84764,7 +84915,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < 1) return null; let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84804,7 +84956,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -85559,14 +85711,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#exclusiveOption_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -85683,7 +85835,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85724,7 +85877,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -85789,14 +85942,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inclusiveOption_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -85913,7 +86066,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -85954,7 +86108,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -86049,14 +86203,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quote_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -86173,7 +86327,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86213,7 +86368,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -86300,14 +86455,14 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#quoteAuthorization_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -86423,7 +86578,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86463,7 +86619,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88258,14 +88414,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#subject_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -88383,7 +88539,8 @@ relationships?: (Object | URL)[];} if (this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < 1) return null; let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88423,7 +88580,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88487,14 +88644,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#object_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -88609,7 +88766,8 @@ relationships?: (Object | URL)[];} if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88649,7 +88807,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88713,7 +88871,8 @@ relationships?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88754,7 +88913,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88819,14 +88978,14 @@ relationships?: (Object | URL)[];} throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#relationship_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -88943,7 +89102,8 @@ relationships?: (Object | URL)[];} if (this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < 1) return null; let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -88983,7 +89143,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -89049,7 +89209,8 @@ relationships?: (Object | URL)[];} for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89090,7 +89251,7 @@ relationships?: (Object | URL)[];} } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91077,14 +91238,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#publicKey_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -91198,7 +91359,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91238,7 +91400,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91301,7 +91463,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91342,7 +91505,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91407,14 +91570,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#assertionMethod_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -91532,7 +91695,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91572,7 +91736,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91639,7 +91803,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91680,7 +91845,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91764,14 +91929,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#inbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -91907,7 +92072,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -91947,7 +92113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92011,14 +92177,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#outbox_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92151,7 +92317,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92191,7 +92358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92255,14 +92422,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#following_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92381,7 +92548,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92421,7 +92589,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92485,14 +92653,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#followers_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92614,7 +92782,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92654,7 +92823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92718,14 +92887,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#liked_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92845,7 +93014,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -92885,7 +93055,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92949,14 +93119,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featured_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93074,7 +93244,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93114,7 +93285,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93178,14 +93349,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#featuredTags_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93303,7 +93474,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93343,7 +93515,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93407,14 +93579,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#stream_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93529,7 +93701,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93570,7 +93743,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93710,14 +93883,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#successor_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93867,7 +94040,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -93907,7 +94081,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93971,14 +94145,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#alias_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -94132,7 +94306,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94172,7 +94347,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94239,7 +94414,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94280,7 +94456,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94345,14 +94521,14 @@ get preferredUsernames(): ((string | LanguageString))[] { throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#service_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -94470,7 +94646,8 @@ get preferredUsernames(): ((string | LanguageString))[] { if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94510,7 +94687,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94577,7 +94754,8 @@ get preferredUsernames(): ((string | LanguageString))[] { for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94618,7 +94796,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 819081e80..c683ddcba 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -226,6 +226,7 @@ export async function* generateClasses( "exportSpki", "formatIri", "getDocumentLoader", + "haveSameIriOrigin", "importMultibaseKey", "importPem", "isDecimal", diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index e000066b3..9504fa8e0 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -105,14 +105,14 @@ async function* generateProperty( throw error; } const { document, documentUrl } = fetchResult; - const baseUrl = new URL(documentUrl); + const baseUrl = parseIri(documentUrl); try { const obj = await this.#${property.singularName}_fromJsonLd( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); if (options.crossOrigin !== "trust" && obj?.id != null && - obj.id.origin !== baseUrl.origin) { + !haveSameIriOrigin(obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -276,7 +276,8 @@ async function* generateProperty( if (this.${await getFieldName(property.uri)}.length < 1) return null; let v = this.${await getFieldName(property.uri)}[0]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { v = v.id; } @@ -316,7 +317,7 @@ async function* generateProperty( } yield ` if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -381,7 +382,8 @@ async function* generateProperty( for (let i = 0; i < vs.length; i++) { let v = vs[i]; if (options.crossOrigin !== "trust" && !(v instanceof URL) && - v.id != null && v.id.origin !== this.id?.origin && + v.id != null && + (this.id == null || !haveSameIriOrigin(v.id, this.id)) && !this.${await getFieldName(property.uri, "#_trust")}.has(i)) { v = v.id; } @@ -422,7 +424,7 @@ async function* generateProperty( } yield ` if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && v.id.origin !== this.id.origin && + this.id != null && !haveSameIriOrigin(v.id, this.id) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { if (options.crossOrigin === "throw") { throw new Error( diff --git a/packages/vocab/src/lookup.ts b/packages/vocab/src/lookup.ts index d2164ec38..9378ba424 100644 --- a/packages/vocab/src/lookup.ts +++ b/packages/vocab/src/lookup.ts @@ -2,6 +2,8 @@ import type { GetUserAgentOptions } from "@fedify/vocab-runtime"; import { type DocumentLoader, getDocumentLoader, + haveSameIriOrigin, + parseIri, type RemoteDocument, } from "@fedify/vocab-runtime"; import { lookupWebFinger } from "@fedify/webfinger"; @@ -312,12 +314,13 @@ async function lookupObjectInternal( } if (remoteDoc == null) return null; let object: Object; + const documentUrl = parseIri(remoteDoc.documentUrl); try { object = await Object.fromJsonLd(remoteDoc.document, { documentLoader, contextLoader: options.contextLoader, tracerProvider: options.tracerProvider, - baseUrl: new URL(remoteDoc.documentUrl), + baseUrl: documentUrl, }); } catch (error) { if (error instanceof TypeError) { @@ -331,7 +334,7 @@ async function lookupObjectInternal( } if ( options.crossOrigin !== "trust" && object.id != null && - object.id.origin !== new URL(remoteDoc.documentUrl).origin + !haveSameIriOrigin(object.id, documentUrl) ) { if (options.crossOrigin === "throw") { throw new Error( diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 9af3f7e2b..9baa8ccec 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -3479,6 +3479,44 @@ test("FEP-fe34: Constructor vs JSON-LD parsing trust difference", async () => { deepStrictEqual(jsonLdResult?.content, "Fetched from origin"); }); +test( + "FEP-fe34: Portable DID authorities are cross-origin boundaries", + async () => { + const create = await Create.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + "@type": "Create", + "@id": "ap://did:key:z6MkOwner/create", + "actor": "ap://did:key:z6MkOwner/actor", + "object": { + "@type": "Note", + "@id": "ap://did:key:z6MkOther/note", + "content": "Embedded portable note", + }, + }); + + // deno-lint-ignore require-await + const documentLoader = async (url: string) => { + if (url === "ap+ef61://did%3Akey%3Az6MkOther/note") { + return { + documentUrl: url, + contextUrl: null, + document: { + "@context": "https://www.w3.org/ns/activitystreams", + "@type": "Note", + "@id": "ap://did:key:z6MkOther/note", + "content": "Fetched portable note", + }, + }; + } + throw new Error("Document not found"); + }; + + const result = await create.getObject({ documentLoader }); + assertInstanceOf(result, Note); + deepStrictEqual(result.content, "Fetched portable note"); + }, +); + test("FEP-fe34: Array properties respect cross-origin policy", async () => { // deno-lint-ignore require-await const crossOriginDocumentLoader = async (url: string) => { From 680920469250a658a93b13fd06fa9f732d16a4e5 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Tue, 30 Jun 2026 19:51:37 +0900 Subject: [PATCH 34/55] Document portable IRI syntax caveat Note that the readable ap://did:... authority form is not RFC 3986 compliant, and that Fedify currently accepts it by normalizing the DID authority into a percent-encoded URL authority internally. Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 7ca2eafa4..9087d9b63 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -75,6 +75,11 @@ function getComparableIriOrigin(iri: URL): string { function parsePortableIri(iri: string): URL | null { const match = iri.match(PORTABLE_IRI_PATTERN); if (match == null) return null; + // The readable ap://did:... authority form is not RFC 3986 compliant: + // colons are not valid in a URI reg-name authority. Keep accepting it for + // current FEP-ef61 interoperability, but normalize it to a percent-encoded + // URL authority internally. The ap: URI syntax may change later; see: + // https://bnewbold.leaflet.pub/3mph4hzvbdc2v const authority = decodePortableAuthority(match[2]); if (!DID_PATTERN.test(authority)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); From a68073e41e85d78c538d6cc265349297b6b1311a Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Wed, 1 Jul 2026 19:22:46 +0900 Subject: [PATCH 35/55] Address portable IRI review feedback Refine the generated class helpers and formatting around portable IRI support, and keep parseIri() failures inside lookupObject()'s existing TypeError recovery path. Also add regression coverage for portable DID URLs that carry encoded DID delimiters. https://github.com/fedify-dev/fedify/pull/850#discussion_r3503649037 https://github.com/fedify-dev/fedify/pull/850#discussion_r3503662468 https://github.com/fedify-dev/fedify/pull/850#discussion_r3503751294 https://github.com/fedify-dev/fedify/pull/850#discussion_r3503767060 https://github.com/fedify-dev/fedify/pull/850#discussion_r3503832890 https://github.com/fedify-dev/fedify/pull/850#discussion_r3504093815 https://github.com/fedify-dev/fedify/pull/850#discussion_r3504324621 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 12 + .../src/__snapshots__/class.test.ts.deno.snap | 3056 ++++++++++------- packages/vocab-tools/src/class.ts | 71 +- packages/vocab-tools/src/codec.ts | 21 +- packages/vocab-tools/src/property.ts | 20 +- packages/vocab/src/lookup.ts | 3 +- 6 files changed, 1983 insertions(+), 1200 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index f51047cb7..05aef3426 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -179,6 +179,18 @@ test("formatIri() preserves DID-internal pct-encoded authority characters", () = ); }); +test("parseIri() accepts portable DID URLs with encoded DID delimiters", () => { + const parsed = parseIri("ap://did:web:example.com%3A3000/u/1"); + deepStrictEqual( + parsed, + new URL("ap+ef61://did%3Aweb%3Aexample.com%253A3000/u/1"), + ); + deepStrictEqual( + formatIri(parsed), + "ap+ef61://did:web:example.com%3A3000/u/1", + ); +}); + test("validatePublicUrl()", async () => { await rejects(() => validatePublicUrl("ftp://localhost"), UrlError); await rejects( diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 478db53a2..992dbf790 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -32,6 +32,15 @@ import { } from \\"@fedify/vocab-runtime/temporal\\"; +function hasTrustedIriOrigin( + options: { crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\" }, + left: URL | null | undefined, + right: URL | null | undefined, +): boolean { + return options.crossOrigin === \\"trust\\" || left == null || + (right != null && haveSameIriOrigin(left, right)); +} + const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); @@ -2469,8 +2478,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2604,9 +2612,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2646,8 +2655,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2718,8 +2727,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2871,9 +2879,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < 1) return null; let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2912,8 +2920,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2978,9 +2986,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3020,8 +3029,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3092,8 +3101,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3208,9 +3216,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < 1) return null; let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3249,8 +3257,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3314,9 +3322,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3356,8 +3365,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3457,8 +3466,7 @@ get contents(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3587,9 +3595,10 @@ get contents(): ((string | LanguageString))[] { const vs = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3629,8 +3638,8 @@ get contents(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3743,8 +3752,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3867,9 +3875,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3909,8 +3918,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3981,8 +3990,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4119,9 +4127,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < 1) return null; let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4160,8 +4168,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4226,9 +4234,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4268,8 +4277,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4340,8 +4349,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4478,9 +4486,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < 1) return null; let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4519,8 +4527,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4585,9 +4593,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4627,8 +4636,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4699,8 +4708,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4824,9 +4832,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < 1) return null; let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4865,8 +4873,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4930,9 +4938,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4972,8 +4981,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5044,8 +5053,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5169,9 +5177,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < 1) return null; let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5210,8 +5218,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5275,9 +5283,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5317,8 +5326,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5389,8 +5398,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5513,9 +5521,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < 1) return null; let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5554,8 +5562,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5618,9 +5626,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5660,8 +5669,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5745,8 +5754,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5861,9 +5869,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < 1) return null; let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5902,8 +5910,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5973,8 +5981,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6095,9 +6102,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < 1) return null; let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6136,8 +6143,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6207,8 +6214,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6329,9 +6335,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < 1) return null; let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6370,8 +6376,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6441,8 +6447,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6557,9 +6562,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < 1) return null; let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6598,8 +6603,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6709,8 +6714,7 @@ get summaries(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6836,9 +6840,10 @@ get summaries(): ((string | LanguageString))[] { const vs = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6878,8 +6883,8 @@ get summaries(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6984,8 +6989,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7100,9 +7104,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < 1) return null; let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7141,8 +7145,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7206,9 +7210,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7248,8 +7253,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7320,8 +7325,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7436,9 +7440,9 @@ get urls(): ((URL | Link))[] { } if (this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < 1) return null; let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7477,8 +7481,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7542,9 +7546,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7584,8 +7589,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7656,8 +7661,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7772,9 +7776,9 @@ get urls(): ((URL | Link))[] { } if (this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < 1) return null; let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7813,8 +7817,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7878,9 +7882,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7920,8 +7925,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7992,8 +7997,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8108,9 +8112,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < 1) return null; let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8149,8 +8153,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8214,9 +8218,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8256,8 +8261,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8392,8 +8397,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8507,9 +8511,9 @@ get urls(): ((URL | Link))[] { } if (this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < 1) return null; let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8548,8 +8552,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8612,9 +8616,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8654,8 +8659,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8765,8 +8770,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8881,9 +8885,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < 1) return null; let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8922,8 +8926,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8993,8 +8997,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9109,9 +9112,9 @@ get urls(): ((URL | Link))[] { } if (this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < 1) return null; let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9150,8 +9153,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -9221,8 +9224,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9337,9 +9339,9 @@ get urls(): ((URL | Link))[] { } if (this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < 1) return null; let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9378,8 +9380,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -10924,10 +10926,19 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -11206,7 +11217,13 @@ get urls(): ((URL | Link))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); @@ -13527,10 +13544,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -13846,8 +13872,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -13963,9 +13988,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -14004,8 +14029,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14098,8 +14123,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -14214,9 +14238,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14255,8 +14279,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14575,10 +14599,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -15471,8 +15504,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15624,9 +15656,9 @@ instruments?: (Object | URL)[];} } if (this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < 1) return null; let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15665,8 +15697,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15731,9 +15763,10 @@ instruments?: (Object | URL)[];} const vs = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15773,8 +15806,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15845,8 +15878,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15962,9 +15994,9 @@ instruments?: (Object | URL)[];} } if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -16003,8 +16035,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16069,9 +16101,10 @@ instruments?: (Object | URL)[];} const vs = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16111,8 +16144,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16183,8 +16216,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16303,9 +16335,9 @@ instruments?: (Object | URL)[];} } if (this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < 1) return null; let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16344,8 +16376,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16413,9 +16445,10 @@ instruments?: (Object | URL)[];} const vs = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16455,8 +16488,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16527,8 +16560,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16644,9 +16676,9 @@ instruments?: (Object | URL)[];} } if (this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < 1) return null; let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16685,8 +16717,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16751,9 +16783,10 @@ instruments?: (Object | URL)[];} const vs = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16793,8 +16826,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16865,8 +16898,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16983,9 +17015,9 @@ instruments?: (Object | URL)[];} } if (this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < 1) return null; let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -17024,8 +17056,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17091,9 +17123,10 @@ instruments?: (Object | URL)[];} const vs = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17133,8 +17166,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17205,8 +17238,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -17321,9 +17353,9 @@ instruments?: (Object | URL)[];} } if (this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < 1) return null; let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17362,8 +17394,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17427,9 +17459,10 @@ instruments?: (Object | URL)[];} const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17469,8 +17502,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17748,10 +17781,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -18599,10 +18641,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -19135,10 +19186,19 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -19161,7 +19221,13 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; @@ -19754,10 +19820,19 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -19780,7 +19855,13 @@ unit?: string | null;numericalValue?: Decimal | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _27fgyFbosTtMAhuepJH8K3ZGURT6: (string)[] = []; @@ -20136,8 +20217,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20252,9 +20332,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20293,8 +20373,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20364,8 +20444,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20479,9 +20558,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20520,8 +20599,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20795,10 +20874,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -21264,10 +21352,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -21888,10 +21985,19 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -21914,7 +22020,13 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike: (InteractionRule)[] = []; @@ -22669,10 +22781,19 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -22695,7 +22816,13 @@ get manualApprovals(): (URL)[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval: (URL)[] = []; @@ -23062,8 +23189,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23178,9 +23304,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23219,8 +23345,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23290,8 +23416,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23405,9 +23530,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23446,8 +23571,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23721,10 +23846,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -24189,10 +24323,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -24484,8 +24627,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24600,9 +24742,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24641,8 +24783,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -24712,8 +24854,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24827,9 +24968,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24868,8 +25009,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -25143,10 +25284,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -25611,10 +25761,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -25906,8 +26065,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26021,9 +26179,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26062,8 +26220,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26133,8 +26291,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26248,9 +26405,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26289,8 +26446,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26564,10 +26721,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -27032,10 +27198,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -27510,10 +27685,19 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -27540,7 +27724,13 @@ get endpoints(): (URL)[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint: (URL)[] = []; @@ -27874,10 +28064,19 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -28296,8 +28495,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -28414,9 +28612,9 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } if (this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < 1) return null; let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28430,8 +28628,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | return fetched; } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -28726,10 +28924,19 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -28752,7 +28959,13 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: (\\"eddsa-jcs-2022\\")[] = []; @@ -29269,8 +29482,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -29419,9 +29631,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < 1) return null; let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29460,8 +29672,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -29733,10 +29945,19 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -29759,7 +29980,13 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); @@ -30182,8 +30409,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -30332,9 +30558,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < 1) return null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30373,8 +30599,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -30653,10 +30879,19 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -30679,7 +30914,13 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); @@ -31302,10 +31543,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -31914,10 +32164,19 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -31940,7 +32199,13 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies: (URL)[] = []; @@ -32750,10 +33015,19 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -32776,7 +33050,13 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action: (string)[] = []; @@ -33633,10 +33913,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -34152,10 +34441,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -34518,10 +34816,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -34879,10 +35186,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -36040,8 +36356,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36154,9 +36469,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36195,8 +36510,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36258,9 +36573,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36300,8 +36616,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36372,8 +36688,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36490,9 +36805,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36531,8 +36846,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36598,9 +36913,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36640,8 +36956,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36731,8 +37047,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36867,9 +37182,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36908,8 +37223,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36979,8 +37294,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37112,9 +37426,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37153,8 +37467,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37224,8 +37538,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37343,9 +37656,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37384,8 +37697,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37455,8 +37768,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37577,9 +37889,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37618,8 +37930,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37689,8 +38001,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37809,9 +38120,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37850,8 +38161,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37921,8 +38232,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38039,9 +38349,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38080,8 +38390,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38151,8 +38461,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38269,9 +38578,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38310,8 +38619,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38381,8 +38690,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38496,9 +38804,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38538,8 +38847,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38685,8 +38994,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38835,9 +39143,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38876,8 +39184,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38947,8 +39255,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39101,9 +39408,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39142,8 +39449,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39209,9 +39516,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39251,8 +39559,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39323,8 +39631,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39441,9 +39748,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39482,8 +39789,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39549,9 +39856,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39591,8 +39899,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -40622,10 +40930,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -42072,10 +42389,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -42445,10 +42771,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -42759,8 +43094,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -42876,9 +43210,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42917,8 +43251,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -43011,8 +43345,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -43127,9 +43460,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43168,8 +43501,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -43488,10 +43821,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -44149,10 +44491,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -44604,10 +44955,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -44964,10 +45324,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -45330,10 +45699,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -45968,8 +46346,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46084,9 +46461,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < 1) return null; let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46125,8 +46502,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46196,8 +46573,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46312,9 +46688,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < 1) return null; let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46353,8 +46729,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46424,8 +46800,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46540,9 +46915,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < 1) return null; let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46581,8 +46956,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46652,8 +47027,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46777,9 +47151,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46819,8 +47194,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46891,8 +47266,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47006,9 +47380,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < 1) return null; let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -47047,8 +47421,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47118,8 +47492,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47233,9 +47606,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < 1) return null; let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47274,8 +47647,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47345,8 +47718,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47460,9 +47832,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < 1) return null; let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47501,8 +47873,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47572,8 +47944,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47687,9 +48058,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < 1) return null; let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47728,8 +48099,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47799,8 +48170,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47914,9 +48284,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < 1) return null; let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47955,8 +48325,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48026,8 +48396,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48141,9 +48510,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < 1) return null; let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48182,8 +48551,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48253,8 +48622,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48368,9 +48736,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < 1) return null; let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48409,8 +48777,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48480,8 +48848,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48595,9 +48962,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < 1) return null; let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48636,8 +49003,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -49299,10 +49666,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -50280,8 +50656,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50396,9 +50771,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < 1) return null; let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50437,8 +50812,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50508,8 +50883,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50622,9 +50996,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < 1) return null; let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50663,8 +51037,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50734,8 +51108,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50849,9 +51222,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < 1) return null; let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50890,8 +51263,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -51200,10 +51573,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -51712,10 +52094,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -52072,10 +52463,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -52430,10 +52830,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -53257,10 +53666,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -53283,7 +53701,13 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl: (URL)[] = []; @@ -53858,10 +54282,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -54219,10 +54652,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -54581,10 +55023,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -55742,8 +56193,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -55856,9 +56306,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55897,8 +56347,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55960,9 +56410,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -56002,8 +56453,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56074,8 +56525,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56192,9 +56642,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56233,8 +56683,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56300,9 +56750,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56342,8 +56793,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56433,8 +56884,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56569,9 +57019,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56610,8 +57060,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56681,8 +57131,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56814,9 +57263,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56855,8 +57304,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56926,8 +57375,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57045,9 +57493,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -57086,8 +57534,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57157,8 +57605,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57279,9 +57726,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57320,8 +57767,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57391,8 +57838,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57511,9 +57957,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57552,8 +57998,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57623,8 +58069,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57741,9 +58186,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57782,8 +58227,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57853,8 +58298,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57971,9 +58415,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -58012,8 +58456,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58083,8 +58527,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58198,9 +58641,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58240,8 +58684,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58387,8 +58831,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58537,9 +58980,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58578,8 +59021,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58649,8 +59092,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58803,9 +59245,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58844,8 +59286,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58911,9 +59353,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58953,8 +59396,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -59025,8 +59468,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -59143,9 +59585,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59184,8 +59626,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -59251,9 +59693,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59293,8 +59736,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -60324,10 +60767,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -62142,8 +62594,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -62265,9 +62716,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62307,8 +62759,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -62759,10 +63211,19 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -62793,7 +63254,13 @@ get names(): ((string | LanguageString))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; @@ -63450,10 +63917,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -63813,10 +64289,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -64174,10 +64659,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -64538,10 +65032,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -64898,10 +65401,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -65258,10 +65770,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -65618,10 +66139,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -65976,10 +66506,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -66300,10 +66839,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -66661,10 +67209,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -66977,8 +67534,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -67094,9 +67650,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67135,8 +67691,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67229,8 +67785,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -67345,9 +67900,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67386,8 +67941,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67706,10 +68261,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -68125,8 +68689,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68250,9 +68813,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68292,8 +68856,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -68534,10 +69098,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -68897,8 +69470,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -69022,9 +69594,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -69064,8 +69637,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -69355,10 +69928,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -70616,8 +71198,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70730,9 +71311,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70771,8 +71352,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70834,9 +71415,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70876,8 +71458,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70948,8 +71530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71066,9 +71647,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -71107,8 +71688,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71174,9 +71755,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71216,8 +71798,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71307,8 +71889,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71443,9 +72024,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71484,8 +72065,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71555,8 +72136,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71688,9 +72268,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71729,8 +72309,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71800,8 +72380,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71919,9 +72498,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71960,8 +72539,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72031,8 +72610,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72153,9 +72731,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72194,8 +72772,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72265,8 +72843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72385,9 +72962,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72426,8 +73003,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72497,8 +73074,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72615,9 +73191,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72656,8 +73232,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72727,8 +73303,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72845,9 +73420,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72886,8 +73461,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72957,8 +73532,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73072,9 +73646,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -73114,8 +73689,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73261,8 +73836,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73411,9 +73985,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73452,8 +74026,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73523,8 +74097,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73677,9 +74250,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73718,8 +74291,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73785,9 +74358,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73827,8 +74401,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73899,8 +74473,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -74017,9 +74590,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -74058,8 +74631,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -74125,9 +74698,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74167,8 +74741,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -75198,10 +75772,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -76650,10 +77233,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -77811,8 +78403,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -77925,9 +78516,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77966,8 +78557,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78029,9 +78620,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -78071,8 +78663,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78143,8 +78735,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78261,9 +78852,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78302,8 +78893,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78369,9 +78960,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78411,8 +79003,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78502,8 +79094,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78638,9 +79229,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78679,8 +79270,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78750,8 +79341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78883,9 +79473,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78924,8 +79514,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78995,8 +79585,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79114,9 +79703,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79155,8 +79744,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79226,8 +79815,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79348,9 +79936,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79389,8 +79977,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79460,8 +80048,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79580,9 +80167,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79621,8 +80208,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79692,8 +80279,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79810,9 +80396,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79851,8 +80437,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79922,8 +80508,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80040,9 +80625,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -80081,8 +80666,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80152,8 +80737,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80267,9 +80851,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80309,8 +80894,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80456,8 +81041,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80606,9 +81190,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80647,8 +81231,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80718,8 +81302,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80872,9 +81455,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80913,8 +81496,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80980,9 +81563,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -81022,8 +81606,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -81094,8 +81678,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -81212,9 +81795,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81253,8 +81836,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -81320,9 +81903,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81362,8 +81946,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -82393,10 +82977,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -84301,10 +84894,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -84798,8 +85400,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -84914,9 +85515,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < 1) return null; let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84955,8 +85556,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85195,10 +85796,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -85717,8 +86327,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85834,9 +86443,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const vs = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85876,8 +86486,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85948,8 +86558,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86065,9 +86674,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const vs = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -86107,8 +86717,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86209,8 +86819,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86326,9 +86935,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86367,8 +86976,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86461,8 +87070,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86577,9 +87185,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86618,8 +87226,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86921,10 +87529,19 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -87619,10 +88236,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -87979,10 +88605,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -88420,8 +89055,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88538,9 +89172,9 @@ relationships?: (Object | URL)[];} } if (this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < 1) return null; let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88579,8 +89213,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88650,8 +89284,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88765,9 +89398,9 @@ relationships?: (Object | URL)[];} } if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88806,8 +89439,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88870,9 +89503,10 @@ relationships?: (Object | URL)[];} const vs = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88912,8 +89546,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88984,8 +89618,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -89101,9 +89734,9 @@ relationships?: (Object | URL)[];} } if (this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < 1) return null; let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -89142,8 +89775,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89208,9 +89841,10 @@ relationships?: (Object | URL)[];} const vs = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89250,8 +89884,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89561,10 +90195,19 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -90083,10 +90726,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -91244,8 +91896,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91358,9 +92009,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91399,8 +92050,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91462,9 +92113,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91504,8 +92156,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91576,8 +92228,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91694,9 +92345,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91735,8 +92386,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91802,9 +92453,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91844,8 +92496,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91935,8 +92587,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92071,9 +92722,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -92112,8 +92763,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92183,8 +92834,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92316,9 +92966,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92357,8 +93007,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92428,8 +93078,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92547,9 +93196,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92588,8 +93237,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92659,8 +93308,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92781,9 +93429,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92822,8 +93470,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92893,8 +93541,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93013,9 +93660,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -93054,8 +93701,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93125,8 +93772,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93243,9 +93889,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93284,8 +93930,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93355,8 +94001,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93473,9 +94118,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93514,8 +94159,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93585,8 +94230,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93700,9 +94344,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93742,8 +94387,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93889,8 +94534,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94039,9 +94683,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -94080,8 +94724,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94151,8 +94795,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94305,9 +94948,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94346,8 +94989,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94413,9 +95056,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94455,8 +95099,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94527,8 +95171,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94645,9 +95288,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94686,8 +95329,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94753,9 +95396,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94795,8 +95439,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -95826,10 +96470,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -97494,10 +98147,19 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -97520,7 +98182,13 @@ get contents(): ((string | LanguageString))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; @@ -97952,10 +98620,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -98312,10 +98989,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -98888,10 +99574,19 @@ get formerTypes(): (\$EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -99349,10 +100044,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -99714,10 +100418,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -100077,10 +100790,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -100440,10 +101162,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -100799,10 +101530,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index c683ddcba..973261538 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -12,6 +12,26 @@ import { emitOverride } from "./type.ts"; const XSD_ANY_URI = "http://www.w3.org/2001/XMLSchema#anyURI"; const FEDIFY_URL = "fedify:url"; +const RUNTIME_IMPORTS = [ + "canParseDecimal", + "canParseIri", + "decodeMultibase", + "type Decimal", + "type DocumentLoader", + "encodeMultibase", + "exportMultibaseKey", + "exportSpki", + "formatIri", + "getDocumentLoader", + "haveSameIriOrigin", + "importMultibaseKey", + "importPem", + "isDecimal", + "LanguageString", + "parseDecimal", + "parseIri", + "type RemoteDocument", +]; /** * Sorts the given types topologically so that the base types come before the @@ -185,23 +205,27 @@ function canContainIriValue( ); } +function addKeys( + keys: Set, + property: { uri: string; compactName?: string }, +): void { + keys.add(property.uri); + if (property.compactName != null) keys.add(property.compactName); +} + function addPortableIriKeys( keys: Set, property: PropertySchema, types: Record, ): void { if (!canContainIriValue(property, types)) return; - keys.add(property.uri); - if (property.compactName != null) keys.add(property.compactName); + addKeys(keys, property); if ( "redundantProperties" in property && property.redundantProperties != null ) { for (const redundantProperty of property.redundantProperties) { - keys.add(redundantProperty.uri); - if (redundantProperty.compactName != null) { - keys.add(redundantProperty.compactName); - } + addKeys(keys, redundantProperty); } } } @@ -215,39 +239,30 @@ export async function* generateClasses( types: Record, ): AsyncIterable { validateTypeSchemas(types); - const runtimeImports = [ - "canParseDecimal", - "canParseIri", - "decodeMultibase", - "type Decimal", - "type DocumentLoader", - "encodeMultibase", - "exportMultibaseKey", - "exportSpki", - "formatIri", - "getDocumentLoader", - "haveSameIriOrigin", - "importMultibaseKey", - "importPem", - "isDecimal", - "LanguageString", - "parseDecimal", - "parseIri", - "type RemoteDocument", - ]; yield "// deno-lint-ignore-file ban-unused-ignore no-explicit-any no-unused-vars prefer-const verbatim-module-syntax\n"; yield 'import jsonld from "@fedify/vocab-runtime/jsonld";\n'; yield 'import { getLogger } from "@logtape/logtape";\n'; yield `import { type Span, SpanStatusCode, type TracerProvider, trace } from "@opentelemetry/api";\n`; yield `import {\n ${ - runtimeImports.join(",\n ") + RUNTIME_IMPORTS.join(",\n ") }\n} from "@fedify/vocab-runtime";\n`; yield `import { isTemporalDuration, isTemporalInstant, } from "@fedify/vocab-runtime/temporal";\n`; - yield "\n\n"; + yield ` + +function hasTrustedIriOrigin( + options: { crossOrigin?: "ignore" | "throw" | "trust" }, + left: URL | null | undefined, + right: URL | null | undefined, +): boolean { + return options.crossOrigin === "trust" || left == null || + (right != null && haveSameIriOrigin(left, right)); +} + +`; const portableIriKeys = new Set(["@id", "id"]); for (const type of Object.values(types)) { for (const property of type.properties) { diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index cb07e9f93..08b3fe245 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -406,10 +406,19 @@ export async function* generateDecoder( // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } `; @@ -445,7 +454,13 @@ export async function* generateDecoder( if (type.extends == null) { yield ` const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); `; diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index 9504fa8e0..65a21eb63 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -111,8 +111,7 @@ async function* generateProperty( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -275,9 +274,9 @@ async function* generateProperty( } if (this.${await getFieldName(property.uri)}.length < 1) return null; let v = this.${await getFieldName(property.uri)}[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { v = v.id; } @@ -316,8 +315,8 @@ async function* generateProperty( `; } yield ` - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -381,9 +380,10 @@ async function* generateProperty( const vs = this.${await getFieldName(property.uri)}; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.${await getFieldName(property.uri, "#_trust")}.has(i)) { v = v.id; } @@ -423,8 +423,8 @@ async function* generateProperty( `; } yield ` - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { if (options.crossOrigin === "throw") { throw new Error( diff --git a/packages/vocab/src/lookup.ts b/packages/vocab/src/lookup.ts index 9378ba424..c28d9227a 100644 --- a/packages/vocab/src/lookup.ts +++ b/packages/vocab/src/lookup.ts @@ -314,8 +314,9 @@ async function lookupObjectInternal( } if (remoteDoc == null) return null; let object: Object; - const documentUrl = parseIri(remoteDoc.documentUrl); + let documentUrl: URL; try { + documentUrl = parseIri(remoteDoc.documentUrl); object = await Object.fromJsonLd(remoteDoc.document, { documentLoader, contextLoader: options.contextLoader, From ee7316932261078dd51521123c6988a2251b6731 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Wed, 1 Jul 2026 20:03:23 +0900 Subject: [PATCH 36/55] Tighten portable IRI edge cases Check compacted JSON-LD cache keys with an own-property test so prototype names from input data are not mistaken for generated keys. Make the DID method-specific-id hyphen allowance explicit and cover that portable IRI shape in the runtime parser tests. https://github.com/fedify-dev/fedify/pull/850#discussion_r3505097073 https://github.com/fedify-dev/fedify/pull/850#discussion_r3505116258 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 7 +++++++ packages/vocab-runtime/src/url.ts | 2 +- .../vocab-tools/src/__snapshots__/class.test.ts.deno.snap | 3 ++- packages/vocab-tools/src/class.ts | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 05aef3426..08f9e3a61 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -50,6 +50,13 @@ test("parseIri() accepts DID method names that start with digits", () => { ); }); +test("parseIri() accepts hyphens in DID method-specific IDs", () => { + deepStrictEqual( + parseIri("ap+ef61://did:web:foo-bar.example/actor"), + new URL("ap+ef61://did%3Aweb%3Afoo-bar.example/actor"), + ); +}); + test("parseIri() preserves existing URL parsing behavior", () => { deepStrictEqual( parseIri("/actor", new URL("https://example.com/users/alice")), diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 9087d9b63..02625ba0e 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -13,7 +13,7 @@ const PORTABLE_IRI_PATTERN = /^(ap|ap\+ef61):\/\/([^/?#]*)([^?#]*)(\?[^#]*)?(#.*)?$/i; const INVALID_PERCENT_ENCODING_PATTERN = /%(?![0-9A-Fa-f]{2})/; const DID_SCHEME_PATTERN = /^did:/i; -const DID_PATTERN = /^did:[a-z0-9]+:[A-Za-z0-9._%-]+(?::[A-Za-z0-9._%-]+)*$/i; +const DID_PATTERN = /^did:[a-z0-9]+:[-A-Za-z0-9._%]+(?::[-A-Za-z0-9._%]+)*$/i; /** * Checks whether the given string can be parsed as an IRI. diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 992dbf790..7807e20ee 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -219,7 +219,8 @@ async function mergeUnmappedJsonLdTerms( } const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => - key !== \\"@context\\" && !(key in result) + key !== \\"@context\\" && + !globalThis.Object.prototype.hasOwnProperty.call(result, key) ); if (unmappedKeys.length < 1) return result; const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 973261538..3a38190f6 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -442,7 +442,8 @@ function hasTrustedIriOrigin( } const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => - key !== "@context" && !(key in result) + key !== "@context" && + !globalThis.Object.prototype.hasOwnProperty.call(result, key) ); if (unmappedKeys.length < 1) return result; const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { From 1beb7337d33d32b422825e495eb3e853e25f238b Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Wed, 1 Jul 2026 20:16:10 +0900 Subject: [PATCH 37/55] Harden portable IRI cache normalization Normalize percent-encoded DID authorities consistently so equivalent portable IRIs produce the same internal URL. Add depth limits to the JSON-LD cache helpers that recurse through network-provided data. https://github.com/fedify-dev/fedify/pull/850#discussion_r3505337189 https://github.com/fedify-dev/fedify/pull/850#discussion_r3505337207 https://github.com/fedify-dev/fedify/pull/850#discussion_r3505337210 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 7 +++++++ packages/vocab-runtime/src/url.ts | 2 +- .../vocab-tools/src/__snapshots__/class.test.ts.deno.snap | 8 ++++++-- packages/vocab-tools/src/class.ts | 8 ++++++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 08f9e3a61..1bfff3b3d 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -174,6 +174,13 @@ test("formatIri() preserves DID authority pct-encoded delimiters", () => { ); }); +test("parseIri() normalizes equivalent encoded DID authorities", () => { + deepStrictEqual( + parseIri("ap://did:example:abc%252Fdef/actor"), + parseIri("ap://did%3Aexample%3Aabc%252Fdef/actor"), + ); +}); + test("formatIri() preserves DID-internal pct-encoded authority characters", () => { const parsed = parseIri("ap://did:web:example.com%3A3000/actor"); deepStrictEqual( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 02625ba0e..2744cd99a 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -119,7 +119,7 @@ function decodePortableAuthority(authority: string): string { if (INVALID_PERCENT_ENCODING_PATTERN.test(decoded)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } - return authority; + return decoded; } const decoded = authority.replace(/%3A/gi, ":").replace(/%25/gi, "%"); if (INVALID_PERCENT_ENCODING_PATTERN.test(decoded)) { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 7807e20ee..ec7d26e07 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -120,10 +120,11 @@ function normalizePortableIris( return clone ?? object; } -function getJsonLdContext(value: unknown): unknown { +function getJsonLdContext(value: unknown, depth = 0): unknown { + if (depth > 32) return undefined; if (Array.isArray(value)) { for (const item of value) { - const context = getJsonLdContext(item); + const context = getJsonLdContext(item, depth + 1); if (context !== undefined) return context; } return undefined; @@ -141,7 +142,9 @@ async function compactJsonLdCache( normalized: unknown, original: unknown, documentLoader?: DocumentLoader, + depth = 0, ): Promise { + if (depth > 32) return normalized; if (Array.isArray(original)) { const normalizedArray = Array.isArray(normalized) ? normalized @@ -157,6 +160,7 @@ async function compactJsonLdCache( normalizedArray[i], original[i], documentLoader, + depth + 1, ); if (item !== normalizedArray[i]) { clone ??= normalizedArray.slice(0, i); diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 3a38190f6..1d463936d 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -346,10 +346,11 @@ function hasTrustedIriOrigin( } return clone ?? object; }\n\n`; - yield `function getJsonLdContext(value: unknown): unknown { + yield `function getJsonLdContext(value: unknown, depth = 0): unknown { + if (depth > 32) return undefined; if (Array.isArray(value)) { for (const item of value) { - const context = getJsonLdContext(item); + const context = getJsonLdContext(item, depth + 1); if (context !== undefined) return context; } return undefined; @@ -366,7 +367,9 @@ function hasTrustedIriOrigin( normalized: unknown, original: unknown, documentLoader?: DocumentLoader, + depth = 0, ): Promise { + if (depth > 32) return normalized; if (Array.isArray(original)) { const normalizedArray = Array.isArray(normalized) ? normalized @@ -382,6 +385,7 @@ function hasTrustedIriOrigin( normalizedArray[i], original[i], documentLoader, + depth + 1, ); if (item !== normalizedArray[i]) { clone ??= normalizedArray.slice(0, i); From 3c112c3b572ae08d256530a26da718e6d2377ca7 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 16:11:58 +0900 Subject: [PATCH 38/55] Refresh runtime vocab snapshots Refresh the Node.js and Bun snapshots for the generated vocab-tools output. The Deno snapshot had already been updated, but the non-Deno test jobs still compared against the older generated code. https://github.com/fedify-dev/fedify/actions/runs/28513579228/job/84519621757 https://github.com/fedify-dev/fedify/actions/runs/28513579228/job/84519621768 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.node.snap | 3067 ++++++++++------- .../src/__snapshots__/class.test.ts.snap | 3067 ++++++++++------- 2 files changed, 3812 insertions(+), 2322 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 4106b7634..49870ef8d 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -30,6 +30,15 @@ import { } from \\"@fedify/vocab-runtime/temporal\\"; +function hasTrustedIriOrigin( + options: { crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\" }, + left: URL | null | undefined, + right: URL | null | undefined, +): boolean { + return options.crossOrigin === \\"trust\\" || left == null || + (right != null && haveSameIriOrigin(left, right)); +} + const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); @@ -109,10 +118,11 @@ function normalizePortableIris( return clone ?? object; } -function getJsonLdContext(value: unknown): unknown { +function getJsonLdContext(value: unknown, depth = 0): unknown { + if (depth > 32) return undefined; if (Array.isArray(value)) { for (const item of value) { - const context = getJsonLdContext(item); + const context = getJsonLdContext(item, depth + 1); if (context !== undefined) return context; } return undefined; @@ -130,7 +140,9 @@ async function compactJsonLdCache( normalized: unknown, original: unknown, documentLoader?: DocumentLoader, + depth = 0, ): Promise { + if (depth > 32) return normalized; if (Array.isArray(original)) { const normalizedArray = Array.isArray(normalized) ? normalized @@ -146,6 +158,7 @@ async function compactJsonLdCache( normalizedArray[i], original[i], documentLoader, + depth + 1, ); if (item !== normalizedArray[i]) { clone ??= normalizedArray.slice(0, i); @@ -208,7 +221,8 @@ async function mergeUnmappedJsonLdTerms( } const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => - key !== \\"@context\\" && !(key in result) + key !== \\"@context\\" && + !globalThis.Object.prototype.hasOwnProperty.call(result, key) ); if (unmappedKeys.length < 1) return result; const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { @@ -2467,8 +2481,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2602,9 +2615,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2644,8 +2658,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2716,8 +2730,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2869,9 +2882,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < 1) return null; let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2910,8 +2923,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2976,9 +2989,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3018,8 +3032,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3090,8 +3104,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3206,9 +3219,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < 1) return null; let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3247,8 +3260,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3312,9 +3325,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3354,8 +3368,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3455,8 +3469,7 @@ get contents(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3585,9 +3598,10 @@ get contents(): ((string | LanguageString))[] { const vs = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3627,8 +3641,8 @@ get contents(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3741,8 +3755,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3865,9 +3878,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3907,8 +3921,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3979,8 +3993,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4117,9 +4130,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < 1) return null; let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4158,8 +4171,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4224,9 +4237,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4266,8 +4280,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4338,8 +4352,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4476,9 +4489,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < 1) return null; let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4517,8 +4530,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4583,9 +4596,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4625,8 +4639,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4697,8 +4711,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4822,9 +4835,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < 1) return null; let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4863,8 +4876,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4928,9 +4941,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4970,8 +4984,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5042,8 +5056,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5167,9 +5180,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < 1) return null; let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5208,8 +5221,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5273,9 +5286,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5315,8 +5329,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5387,8 +5401,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5511,9 +5524,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < 1) return null; let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5552,8 +5565,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5616,9 +5629,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5658,8 +5672,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5743,8 +5757,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5859,9 +5872,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < 1) return null; let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5900,8 +5913,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5971,8 +5984,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6093,9 +6105,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < 1) return null; let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6134,8 +6146,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6205,8 +6217,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6327,9 +6338,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < 1) return null; let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6368,8 +6379,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6439,8 +6450,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6555,9 +6565,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < 1) return null; let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6596,8 +6606,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6707,8 +6717,7 @@ get summaries(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6834,9 +6843,10 @@ get summaries(): ((string | LanguageString))[] { const vs = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6876,8 +6886,8 @@ get summaries(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6982,8 +6992,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7098,9 +7107,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < 1) return null; let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7139,8 +7148,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7204,9 +7213,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7246,8 +7256,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7318,8 +7328,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7434,9 +7443,9 @@ get urls(): ((URL | Link))[] { } if (this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < 1) return null; let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7475,8 +7484,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7540,9 +7549,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7582,8 +7592,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7654,8 +7664,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7770,9 +7779,9 @@ get urls(): ((URL | Link))[] { } if (this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < 1) return null; let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7811,8 +7820,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7876,9 +7885,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7918,8 +7928,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7990,8 +8000,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8106,9 +8115,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < 1) return null; let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8147,8 +8156,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8212,9 +8221,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8254,8 +8264,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8390,8 +8400,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8505,9 +8514,9 @@ get urls(): ((URL | Link))[] { } if (this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < 1) return null; let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8546,8 +8555,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8610,9 +8619,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8652,8 +8662,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8763,8 +8773,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8879,9 +8888,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < 1) return null; let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8920,8 +8929,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8991,8 +9000,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9107,9 +9115,9 @@ get urls(): ((URL | Link))[] { } if (this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < 1) return null; let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9148,8 +9156,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -9219,8 +9227,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9335,9 +9342,9 @@ get urls(): ((URL | Link))[] { } if (this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < 1) return null; let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9376,8 +9383,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -10922,10 +10929,19 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -11204,7 +11220,13 @@ get urls(): ((URL | Link))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); @@ -13525,10 +13547,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -13844,8 +13875,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -13961,9 +13991,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -14002,8 +14032,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14096,8 +14126,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -14212,9 +14241,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14253,8 +14282,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14573,10 +14602,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -15469,8 +15507,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15622,9 +15659,9 @@ instruments?: (Object | URL)[];} } if (this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < 1) return null; let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15663,8 +15700,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15729,9 +15766,10 @@ instruments?: (Object | URL)[];} const vs = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15771,8 +15809,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15843,8 +15881,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15960,9 +15997,9 @@ instruments?: (Object | URL)[];} } if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -16001,8 +16038,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16067,9 +16104,10 @@ instruments?: (Object | URL)[];} const vs = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16109,8 +16147,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16181,8 +16219,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16301,9 +16338,9 @@ instruments?: (Object | URL)[];} } if (this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < 1) return null; let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16342,8 +16379,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16411,9 +16448,10 @@ instruments?: (Object | URL)[];} const vs = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16453,8 +16491,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16525,8 +16563,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16642,9 +16679,9 @@ instruments?: (Object | URL)[];} } if (this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < 1) return null; let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16683,8 +16720,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16749,9 +16786,10 @@ instruments?: (Object | URL)[];} const vs = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16791,8 +16829,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16863,8 +16901,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16981,9 +17018,9 @@ instruments?: (Object | URL)[];} } if (this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < 1) return null; let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -17022,8 +17059,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17089,9 +17126,10 @@ instruments?: (Object | URL)[];} const vs = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17131,8 +17169,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17203,8 +17241,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -17319,9 +17356,9 @@ instruments?: (Object | URL)[];} } if (this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < 1) return null; let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17360,8 +17397,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17425,9 +17462,10 @@ instruments?: (Object | URL)[];} const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17467,8 +17505,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17746,10 +17784,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -18597,10 +18644,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -19133,10 +19189,19 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -19159,7 +19224,13 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; @@ -19752,10 +19823,19 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -19778,7 +19858,13 @@ unit?: string | null;numericalValue?: Decimal | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _27fgyFbosTtMAhuepJH8K3ZGURT6: (string)[] = []; @@ -20134,8 +20220,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20250,9 +20335,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20291,8 +20376,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20362,8 +20447,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20477,9 +20561,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20518,8 +20602,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20793,10 +20877,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -21262,10 +21355,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -21886,10 +21988,19 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -21912,7 +22023,13 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike: (InteractionRule)[] = []; @@ -22667,10 +22784,19 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -22693,7 +22819,13 @@ get manualApprovals(): (URL)[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval: (URL)[] = []; @@ -23060,8 +23192,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23176,9 +23307,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23217,8 +23348,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23288,8 +23419,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23403,9 +23533,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23444,8 +23574,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23719,10 +23849,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -24187,10 +24326,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -24482,8 +24630,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24598,9 +24745,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24639,8 +24786,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -24710,8 +24857,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24825,9 +24971,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24866,8 +25012,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -25141,10 +25287,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -25609,10 +25764,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -25904,8 +26068,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26019,9 +26182,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26060,8 +26223,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26131,8 +26294,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26246,9 +26408,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26287,8 +26449,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26562,10 +26724,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -27030,10 +27201,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -27508,10 +27688,19 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -27538,7 +27727,13 @@ get endpoints(): (URL)[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint: (URL)[] = []; @@ -27872,10 +28067,19 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -28294,8 +28498,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -28412,9 +28615,9 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } if (this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < 1) return null; let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28428,8 +28631,8 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | return fetched; } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -28724,10 +28927,19 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -28750,7 +28962,13 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: (\\"eddsa-jcs-2022\\")[] = []; @@ -29267,8 +29485,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -29417,9 +29634,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < 1) return null; let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29458,8 +29675,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -29731,10 +29948,19 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -29757,7 +29983,13 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); @@ -30180,8 +30412,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -30330,9 +30561,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < 1) return null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30371,8 +30602,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -30651,10 +30882,19 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -30677,7 +30917,13 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); @@ -31300,10 +31546,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -31912,10 +32167,19 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -31938,7 +32202,13 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies: (URL)[] = []; @@ -32748,10 +33018,19 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -32774,7 +33053,13 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action: (string)[] = []; @@ -33631,10 +33916,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -34150,10 +34444,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -34516,10 +34819,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -34877,10 +35189,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -36038,8 +36359,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36152,9 +36472,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36193,8 +36513,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36256,9 +36576,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36298,8 +36619,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36370,8 +36691,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36488,9 +36808,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36529,8 +36849,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36596,9 +36916,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36638,8 +36959,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36729,8 +37050,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36865,9 +37185,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36906,8 +37226,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36977,8 +37297,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37110,9 +37429,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37151,8 +37470,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37222,8 +37541,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37341,9 +37659,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37382,8 +37700,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37453,8 +37771,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37575,9 +37892,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37616,8 +37933,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37687,8 +38004,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37807,9 +38123,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37848,8 +38164,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37919,8 +38235,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38037,9 +38352,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38078,8 +38393,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38149,8 +38464,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38267,9 +38581,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38308,8 +38622,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38379,8 +38693,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38494,9 +38807,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38536,8 +38850,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38683,8 +38997,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38833,9 +39146,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38874,8 +39187,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38945,8 +39258,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39099,9 +39411,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39140,8 +39452,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39207,9 +39519,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39249,8 +39562,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39321,8 +39634,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39439,9 +39751,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39480,8 +39792,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39547,9 +39859,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39589,8 +39902,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -40620,10 +40933,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -42070,10 +42392,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -42443,10 +42774,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -42757,8 +43097,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -42874,9 +43213,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42915,8 +43254,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -43009,8 +43348,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -43125,9 +43463,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43166,8 +43504,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -43486,10 +43824,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -44147,10 +44494,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -44602,10 +44958,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -44962,10 +45327,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -45328,10 +45702,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -45966,8 +46349,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46082,9 +46464,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < 1) return null; let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46123,8 +46505,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46194,8 +46576,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46310,9 +46691,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < 1) return null; let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46351,8 +46732,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46422,8 +46803,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46538,9 +46918,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < 1) return null; let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46579,8 +46959,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46650,8 +47030,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46775,9 +47154,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46817,8 +47197,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46889,8 +47269,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47004,9 +47383,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < 1) return null; let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -47045,8 +47424,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47116,8 +47495,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47231,9 +47609,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < 1) return null; let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47272,8 +47650,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47343,8 +47721,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47458,9 +47835,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < 1) return null; let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47499,8 +47876,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47570,8 +47947,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47685,9 +48061,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < 1) return null; let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47726,8 +48102,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47797,8 +48173,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47912,9 +48287,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < 1) return null; let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47953,8 +48328,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48024,8 +48399,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48139,9 +48513,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < 1) return null; let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48180,8 +48554,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48251,8 +48625,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48366,9 +48739,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < 1) return null; let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48407,8 +48780,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48478,8 +48851,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48593,9 +48965,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < 1) return null; let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48634,8 +49006,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -49297,10 +49669,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -50278,8 +50659,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50394,9 +50774,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < 1) return null; let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50435,8 +50815,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50506,8 +50886,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50620,9 +50999,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < 1) return null; let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50661,8 +51040,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50732,8 +51111,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50847,9 +51225,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < 1) return null; let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50888,8 +51266,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -51198,10 +51576,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -51710,10 +52097,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -52070,10 +52466,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -52428,10 +52833,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -53255,10 +53669,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -53281,7 +53704,13 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl: (URL)[] = []; @@ -53856,10 +54285,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -54217,10 +54655,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -54579,10 +55026,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -55740,8 +56196,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -55854,9 +56309,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55895,8 +56350,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55958,9 +56413,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -56000,8 +56456,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56072,8 +56528,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56190,9 +56645,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56231,8 +56686,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56298,9 +56753,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56340,8 +56796,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56431,8 +56887,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56567,9 +57022,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56608,8 +57063,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56679,8 +57134,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56812,9 +57266,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56853,8 +57307,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56924,8 +57378,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57043,9 +57496,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -57084,8 +57537,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57155,8 +57608,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57277,9 +57729,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57318,8 +57770,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57389,8 +57841,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57509,9 +57960,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57550,8 +58001,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57621,8 +58072,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57739,9 +58189,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57780,8 +58230,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57851,8 +58301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57969,9 +58418,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -58010,8 +58459,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58081,8 +58530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58196,9 +58644,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58238,8 +58687,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58385,8 +58834,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58535,9 +58983,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58576,8 +59024,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58647,8 +59095,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58801,9 +59248,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58842,8 +59289,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58909,9 +59356,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58951,8 +59399,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -59023,8 +59471,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -59141,9 +59588,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59182,8 +59629,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -59249,9 +59696,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59291,8 +59739,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -60322,10 +60770,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -62140,8 +62597,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -62263,9 +62719,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62305,8 +62762,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -62757,10 +63214,19 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -62791,7 +63257,13 @@ get names(): ((string | LanguageString))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; @@ -63448,10 +63920,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -63811,10 +64292,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -64172,10 +64662,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -64536,10 +65035,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -64896,10 +65404,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -65256,10 +65773,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -65616,10 +66142,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -65974,10 +66509,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -66298,10 +66842,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -66659,10 +67212,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -66975,8 +67537,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -67092,9 +67653,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67133,8 +67694,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67227,8 +67788,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -67343,9 +67903,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67384,8 +67944,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67704,10 +68264,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -68123,8 +68692,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68248,9 +68816,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68290,8 +68859,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -68532,10 +69101,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -68895,8 +69473,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -69020,9 +69597,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -69062,8 +69640,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -69353,10 +69931,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -70614,8 +71201,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70728,9 +71314,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70769,8 +71355,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70832,9 +71418,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70874,8 +71461,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70946,8 +71533,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71064,9 +71650,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -71105,8 +71691,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71172,9 +71758,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71214,8 +71801,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71305,8 +71892,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71441,9 +72027,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71482,8 +72068,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71553,8 +72139,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71686,9 +72271,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71727,8 +72312,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71798,8 +72383,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71917,9 +72501,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71958,8 +72542,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72029,8 +72613,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72151,9 +72734,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72192,8 +72775,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72263,8 +72846,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72383,9 +72965,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72424,8 +73006,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72495,8 +73077,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72613,9 +73194,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72654,8 +73235,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72725,8 +73306,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72843,9 +73423,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72884,8 +73464,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72955,8 +73535,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73070,9 +73649,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -73112,8 +73692,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73259,8 +73839,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73409,9 +73988,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73450,8 +74029,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73521,8 +74100,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73675,9 +74253,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73716,8 +74294,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73783,9 +74361,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73825,8 +74404,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73897,8 +74476,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -74015,9 +74593,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -74056,8 +74634,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -74123,9 +74701,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74165,8 +74744,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -75196,10 +75775,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -76648,10 +77236,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -77809,8 +78406,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -77923,9 +78519,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77964,8 +78560,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78027,9 +78623,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -78069,8 +78666,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78141,8 +78738,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78259,9 +78855,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78300,8 +78896,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78367,9 +78963,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78409,8 +79006,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78500,8 +79097,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78636,9 +79232,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78677,8 +79273,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78748,8 +79344,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78881,9 +79476,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78922,8 +79517,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78993,8 +79588,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79112,9 +79706,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79153,8 +79747,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79224,8 +79818,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79346,9 +79939,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79387,8 +79980,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79458,8 +80051,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79578,9 +80170,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79619,8 +80211,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79690,8 +80282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79808,9 +80399,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79849,8 +80440,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79920,8 +80511,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80038,9 +80628,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -80079,8 +80669,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80150,8 +80740,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80265,9 +80854,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80307,8 +80897,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80454,8 +81044,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80604,9 +81193,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80645,8 +81234,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80716,8 +81305,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80870,9 +81458,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80911,8 +81499,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80978,9 +81566,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -81020,8 +81609,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -81092,8 +81681,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -81210,9 +81798,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81251,8 +81839,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -81318,9 +81906,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81360,8 +81949,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -82391,10 +82980,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -84299,10 +84897,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -84796,8 +85403,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -84912,9 +85518,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < 1) return null; let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84953,8 +85559,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85193,10 +85799,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -85715,8 +86330,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85832,9 +86446,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const vs = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85874,8 +86489,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85946,8 +86561,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86063,9 +86677,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const vs = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -86105,8 +86720,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86207,8 +86822,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86324,9 +86938,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86365,8 +86979,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86459,8 +87073,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86575,9 +87188,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86616,8 +87229,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86919,10 +87532,19 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -87617,10 +88239,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -87977,10 +88608,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -88418,8 +89058,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88536,9 +89175,9 @@ relationships?: (Object | URL)[];} } if (this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < 1) return null; let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88577,8 +89216,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88648,8 +89287,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88763,9 +89401,9 @@ relationships?: (Object | URL)[];} } if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88804,8 +89442,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88868,9 +89506,10 @@ relationships?: (Object | URL)[];} const vs = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88910,8 +89549,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88982,8 +89621,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -89099,9 +89737,9 @@ relationships?: (Object | URL)[];} } if (this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < 1) return null; let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -89140,8 +89778,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89206,9 +89844,10 @@ relationships?: (Object | URL)[];} const vs = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89248,8 +89887,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89559,10 +90198,19 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -90081,10 +90729,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -91242,8 +91899,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91356,9 +92012,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91397,8 +92053,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91460,9 +92116,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91502,8 +92159,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91574,8 +92231,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91692,9 +92348,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91733,8 +92389,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91800,9 +92456,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91842,8 +92499,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91933,8 +92590,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92069,9 +92725,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -92110,8 +92766,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92181,8 +92837,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92314,9 +92969,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92355,8 +93010,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92426,8 +93081,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92545,9 +93199,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92586,8 +93240,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92657,8 +93311,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92779,9 +93432,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92820,8 +93473,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92891,8 +93544,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93011,9 +93663,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -93052,8 +93704,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93123,8 +93775,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93241,9 +93892,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93282,8 +93933,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93353,8 +94004,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93471,9 +94121,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93512,8 +94162,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93583,8 +94233,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93698,9 +94347,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93740,8 +94390,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93887,8 +94537,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94037,9 +94686,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -94078,8 +94727,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94149,8 +94798,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94303,9 +94951,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94344,8 +94992,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94411,9 +95059,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94453,8 +95102,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94525,8 +95174,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== \\"trust\\" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94643,9 +95291,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94684,8 +95332,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94751,9 +95399,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== \\"trust\\" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94793,8 +95442,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== \\"trust\\" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -95824,10 +96473,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -97492,10 +98150,19 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -97518,7 +98185,13 @@ get contents(): ((string | LanguageString))[] { } const instance = new this( - { id: values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"], options.baseUrl) ? parseIri(values[\\"@id\\"], options.baseUrl) : undefined }, + { + id: values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"], options.baseUrl) + ? parseIri(values[\\"@id\\"], options.baseUrl) + : undefined + }, options, ); const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; @@ -97950,10 +98623,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -98310,10 +98992,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -98886,10 +99577,19 @@ get formerTypes(): ($EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -99347,10 +100047,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -99712,10 +100421,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -100075,10 +100793,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -100438,10 +101165,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } @@ -100797,10 +101533,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if (values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && !canParseIri(values[\\"@id\\"], options.baseUrl)) { + if ( + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + !canParseIri(values[\\"@id\\"], options.baseUrl) + ) { throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); } - if (options.baseUrl == null && values[\\"@id\\"] != null && !values[\\"@id\\"].startsWith(\\"_:\\") && canParseIri(values[\\"@id\\"])) { + if ( + options.baseUrl == null && + values[\\"@id\\"] != null && + !values[\\"@id\\"].startsWith(\\"_:\\") && + canParseIri(values[\\"@id\\"]) + ) { options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 2492c91df..805197e80 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -32,6 +32,15 @@ import { } from "@fedify/vocab-runtime/temporal"; +function hasTrustedIriOrigin( + options: { crossOrigin?: "ignore" | "throw" | "trust" }, + left: URL | null | undefined, + right: URL | null | undefined, +): boolean { + return options.crossOrigin === "trust" || left == null || + (right != null && haveSameIriOrigin(left, right)); +} + const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","_misskey_quote","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","quoteUri","quoteUrl","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); @@ -111,10 +120,11 @@ function normalizePortableIris( return clone ?? object; } -function getJsonLdContext(value: unknown): unknown { +function getJsonLdContext(value: unknown, depth = 0): unknown { + if (depth > 32) return undefined; if (Array.isArray(value)) { for (const item of value) { - const context = getJsonLdContext(item); + const context = getJsonLdContext(item, depth + 1); if (context !== undefined) return context; } return undefined; @@ -132,7 +142,9 @@ async function compactJsonLdCache( normalized: unknown, original: unknown, documentLoader?: DocumentLoader, + depth = 0, ): Promise { + if (depth > 32) return normalized; if (Array.isArray(original)) { const normalizedArray = Array.isArray(normalized) ? normalized @@ -148,6 +160,7 @@ async function compactJsonLdCache( normalizedArray[i], original[i], documentLoader, + depth + 1, ); if (item !== normalizedArray[i]) { clone ??= normalizedArray.slice(0, i); @@ -210,7 +223,8 @@ async function mergeUnmappedJsonLdTerms( } const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => - key !== "@context" && !(key in result) + key !== "@context" && + !globalThis.Object.prototype.hasOwnProperty.call(result, key) ); if (unmappedKeys.length < 1) return result; const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { @@ -2469,8 +2483,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -2604,9 +2617,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_49BipA5dq9eoH8LX8xdsVumveTca_attachment; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2646,8 +2660,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -2718,8 +2732,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -2871,9 +2884,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.length < 1) return null; let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2912,8 +2925,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -2978,9 +2991,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3020,8 +3034,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3092,8 +3106,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3208,9 +3221,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.length < 1) return null; let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3249,8 +3262,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3314,9 +3327,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3356,8 +3370,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3457,8 +3471,7 @@ get contents(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3587,9 +3600,10 @@ get contents(): ((string | LanguageString))[] { const vs = this.#_3mhZzGXSpQ431mBSz2kvych22v4e_context; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3629,8 +3643,8 @@ get contents(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3743,8 +3757,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3867,9 +3880,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_86xFhmgBapoMvYqjbjRuDPayTrS_generator; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3909,8 +3923,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3981,8 +3995,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4119,9 +4132,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.length < 1) return null; let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4160,8 +4173,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4226,9 +4239,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4268,8 +4282,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4340,8 +4354,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4478,9 +4491,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.length < 1) return null; let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4519,8 +4532,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4585,9 +4598,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4627,8 +4641,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4699,8 +4713,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4824,9 +4837,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.length < 1) return null; let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4865,8 +4878,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4930,9 +4943,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4972,8 +4986,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5044,8 +5058,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5169,9 +5182,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.length < 1) return null; let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5210,8 +5223,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5275,9 +5288,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5317,8 +5331,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5389,8 +5403,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5513,9 +5526,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview.length < 1) return null; let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5554,8 +5567,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5618,9 +5631,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5660,8 +5674,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5745,8 +5759,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5861,9 +5874,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_7UpwM3JWcXhADcscukEehBorf6k_replies.length < 1) return null; let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5902,8 +5915,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5973,8 +5986,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6095,9 +6107,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares.length < 1) return null; let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6136,8 +6148,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6207,8 +6219,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6329,9 +6340,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.length < 1) return null; let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6370,8 +6381,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6441,8 +6452,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6557,9 +6567,9 @@ get names(): ((string | LanguageString))[] { } if (this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.length < 1) return null; let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6598,8 +6608,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6709,8 +6719,7 @@ get summaries(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6836,9 +6845,10 @@ get summaries(): ((string | LanguageString))[] { const vs = this.#_5chuqj6s95p5gg2sk1HntGfarRf_tag; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6878,8 +6888,8 @@ get summaries(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6984,8 +6994,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7100,9 +7109,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.length < 1) return null; let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7141,8 +7150,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7206,9 +7215,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7248,8 +7258,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7320,8 +7330,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7436,9 +7445,9 @@ get urls(): ((URL | Link))[] { } if (this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.length < 1) return null; let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7477,8 +7486,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7542,9 +7551,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7584,8 +7594,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7656,8 +7666,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7772,9 +7781,9 @@ get urls(): ((URL | Link))[] { } if (this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.length < 1) return null; let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7813,8 +7822,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7878,9 +7887,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7920,8 +7930,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7992,8 +8002,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8108,9 +8117,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.length < 1) return null; let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8149,8 +8158,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8214,9 +8223,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8256,8 +8266,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8392,8 +8402,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8507,9 +8516,9 @@ get urls(): ((URL | Link))[] { } if (this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.length < 1) return null; let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8548,8 +8557,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8612,9 +8621,10 @@ get urls(): ((URL | Link))[] { const vs = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8654,8 +8664,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8765,8 +8775,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8881,9 +8890,9 @@ get urls(): ((URL | Link))[] { } if (this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.length < 1) return null; let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8922,8 +8931,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8993,8 +9002,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -9109,9 +9117,9 @@ get urls(): ((URL | Link))[] { } if (this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.length < 1) return null; let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9150,8 +9158,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -9221,8 +9229,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -9337,9 +9344,9 @@ get urls(): ((URL | Link))[] { } if (this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.length < 1) return null; let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9378,8 +9385,8 @@ get urls(): ((URL | Link))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -10924,10 +10931,19 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -11206,7 +11222,13 @@ get urls(): ((URL | Link))[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); @@ -13527,10 +13549,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -13846,8 +13877,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -13963,9 +13993,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -14004,8 +14034,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -14098,8 +14128,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -14214,9 +14243,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14255,8 +14284,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -14575,10 +14604,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -15471,8 +15509,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -15624,9 +15661,9 @@ instruments?: (Object | URL)[];} } if (this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.length < 1) return null; let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15665,8 +15702,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -15731,9 +15768,10 @@ instruments?: (Object | URL)[];} const vs = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15773,8 +15811,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -15845,8 +15883,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -15962,9 +15999,9 @@ instruments?: (Object | URL)[];} } if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -16003,8 +16040,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16069,9 +16106,10 @@ instruments?: (Object | URL)[];} const vs = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16111,8 +16149,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16183,8 +16221,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16303,9 +16340,9 @@ instruments?: (Object | URL)[];} } if (this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.length < 1) return null; let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16344,8 +16381,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16413,9 +16450,10 @@ instruments?: (Object | URL)[];} const vs = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16455,8 +16493,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16527,8 +16565,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16644,9 +16681,9 @@ instruments?: (Object | URL)[];} } if (this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.length < 1) return null; let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16685,8 +16722,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16751,9 +16788,10 @@ instruments?: (Object | URL)[];} const vs = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16793,8 +16831,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16865,8 +16903,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16983,9 +17020,9 @@ instruments?: (Object | URL)[];} } if (this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin.length < 1) return null; let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -17024,8 +17061,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17091,9 +17128,10 @@ instruments?: (Object | URL)[];} const vs = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17133,8 +17171,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17205,8 +17243,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -17321,9 +17358,9 @@ instruments?: (Object | URL)[];} } if (this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.length < 1) return null; let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17362,8 +17399,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17427,9 +17464,10 @@ instruments?: (Object | URL)[];} const vs = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17469,8 +17507,8 @@ instruments?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17748,10 +17786,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -18599,10 +18646,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -19135,10 +19191,19 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -19161,7 +19226,13 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _4ZHbBuK7PrsvGgrjM8wgc6KMWjav_name: ((string | LanguageString))[] = []; @@ -19754,10 +19825,19 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -19780,7 +19860,13 @@ unit?: string | null;numericalValue?: Decimal | null;} } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _27fgyFbosTtMAhuepJH8K3ZGURT6: (string)[] = []; @@ -20136,8 +20222,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -20252,9 +20337,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20293,8 +20378,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -20364,8 +20449,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -20479,9 +20563,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20520,8 +20604,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -20795,10 +20879,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -21264,10 +21357,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -21888,10 +21990,19 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -21914,7 +22025,13 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _3JkwVLb3BNCwCWdsb5RftGAg8vyT_canLike: (InteractionRule)[] = []; @@ -22669,10 +22786,19 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -22695,7 +22821,13 @@ get manualApprovals(): (URL)[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _2rFyCF14HoyNjitj9PmCzek5iSsg_automaticApproval: (URL)[] = []; @@ -23062,8 +23194,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -23178,9 +23309,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23219,8 +23350,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -23290,8 +23421,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -23405,9 +23535,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23446,8 +23576,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -23721,10 +23851,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -24189,10 +24328,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -24484,8 +24632,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -24600,9 +24747,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24641,8 +24788,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -24712,8 +24859,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -24827,9 +24973,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24868,8 +25014,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -25143,10 +25289,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -25611,10 +25766,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -25906,8 +26070,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -26021,9 +26184,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.length < 1) return null; let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26062,8 +26225,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -26133,8 +26296,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -26248,9 +26410,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.length < 1) return null; let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26289,8 +26451,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -26564,10 +26726,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -27032,10 +27203,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -27510,10 +27690,19 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -27540,7 +27729,13 @@ get endpoints(): (URL)[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _2KM4fetG6FTJ1cphj76rzJ8Dyv7p_serviceEndpoint: (URL)[] = []; @@ -27874,10 +28069,19 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -28296,8 +28500,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -28414,9 +28617,9 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } if (this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.length < 1) return null; let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28430,8 +28633,8 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null return fetched; } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -28726,10 +28929,19 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -28752,7 +28964,13 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _3RurJsa7tnptyqMFR5hDGcP9pMs5_cryptosuite: ("eddsa-jcs-2022")[] = []; @@ -29269,8 +29487,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -29419,9 +29636,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.length < 1) return null; let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29460,8 +29677,8 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -29733,10 +29950,19 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -29759,7 +29985,13 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); @@ -30182,8 +30414,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -30332,9 +30563,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.length < 1) return null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30373,8 +30604,8 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -30653,10 +30884,19 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -30679,7 +30919,13 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); @@ -31302,10 +31548,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -31914,10 +32169,19 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -31940,7 +32204,13 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _aCyzDK9TkXtLxrZs7JC8emuYisv_satisfies: (URL)[] = []; @@ -32750,10 +33020,19 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -32776,7 +33055,13 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _38VmZKmXJSBy3AvgqNa9GVqbdphy_action: (string)[] = []; @@ -33633,10 +33918,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -34152,10 +34446,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -34518,10 +34821,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -34879,10 +35191,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -36040,8 +36361,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36154,9 +36474,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36195,8 +36515,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36258,9 +36578,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36300,8 +36621,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36372,8 +36693,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36490,9 +36810,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36531,8 +36851,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36598,9 +36918,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36640,8 +36961,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36731,8 +37052,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36867,9 +37187,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36908,8 +37228,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36979,8 +37299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37112,9 +37431,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37153,8 +37472,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37224,8 +37543,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37343,9 +37661,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37384,8 +37702,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37455,8 +37773,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37577,9 +37894,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37618,8 +37935,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37689,8 +38006,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37809,9 +38125,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37850,8 +38166,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37921,8 +38237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38039,9 +38354,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38080,8 +38395,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38151,8 +38466,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38269,9 +38583,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38310,8 +38624,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38381,8 +38695,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38496,9 +38809,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38538,8 +38852,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38685,8 +38999,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38835,9 +39148,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38876,8 +39189,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38947,8 +39260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -39101,9 +39413,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39142,8 +39454,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39209,9 +39521,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39251,8 +39564,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39323,8 +39636,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -39441,9 +39753,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39482,8 +39794,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39549,9 +39861,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39591,8 +39904,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -40622,10 +40935,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -42072,10 +42394,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -42445,10 +42776,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -42759,8 +43099,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -42876,9 +43215,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42917,8 +43256,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -43011,8 +43350,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -43127,9 +43465,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43168,8 +43506,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -43488,10 +43826,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -44149,10 +44496,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -44604,10 +44960,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -44964,10 +45329,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -45330,10 +45704,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -45968,8 +46351,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46084,9 +46466,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current.length < 1) return null; let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46125,8 +46507,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46196,8 +46578,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46312,9 +46693,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first.length < 1) return null; let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46353,8 +46734,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46424,8 +46805,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46540,9 +46920,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.length < 1) return null; let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46581,8 +46961,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46652,8 +47032,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46777,9 +47156,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46819,8 +47199,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46891,8 +47271,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47006,9 +47385,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.length < 1) return null; let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -47047,8 +47426,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47118,8 +47497,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47233,9 +47611,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.length < 1) return null; let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47274,8 +47652,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47345,8 +47723,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47460,9 +47837,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.length < 1) return null; let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47501,8 +47878,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47572,8 +47949,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47687,9 +48063,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.length < 1) return null; let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47728,8 +48104,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47799,8 +48175,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47914,9 +48289,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.length < 1) return null; let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47955,8 +48330,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -48026,8 +48401,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48141,9 +48515,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.length < 1) return null; let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48182,8 +48556,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -48253,8 +48627,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48368,9 +48741,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.length < 1) return null; let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48409,8 +48782,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -48480,8 +48853,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48595,9 +48967,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.length < 1) return null; let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48636,8 +49008,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -49299,10 +49671,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -50280,8 +50661,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50396,9 +50776,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.length < 1) return null; let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50437,8 +50817,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -50508,8 +50888,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50622,9 +51001,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.length < 1) return null; let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50663,8 +51042,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -50734,8 +51113,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50849,9 +51227,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.length < 1) return null; let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50890,8 +51268,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -51200,10 +51578,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -51712,10 +52099,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -52072,10 +52468,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -52430,10 +52835,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -53257,10 +53671,19 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -53283,7 +53706,13 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _2JCYDbSxEHCCLdBYed33cCETfGyR_proxyUrl: (URL)[] = []; @@ -53858,10 +54287,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -54219,10 +54657,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -54581,10 +55028,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -55742,8 +56198,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -55856,9 +56311,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55897,8 +56352,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -55960,9 +56415,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -56002,8 +56458,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56074,8 +56530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56192,9 +56647,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56233,8 +56688,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56300,9 +56755,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56342,8 +56798,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56433,8 +56889,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56569,9 +57024,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56610,8 +57065,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56681,8 +57136,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56814,9 +57268,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56855,8 +57309,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56926,8 +57380,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57045,9 +57498,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -57086,8 +57539,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57157,8 +57610,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57279,9 +57731,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57320,8 +57772,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57391,8 +57843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57511,9 +57962,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57552,8 +58003,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57623,8 +58074,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57741,9 +58191,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57782,8 +58232,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57853,8 +58303,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57971,9 +58420,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -58012,8 +58461,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58083,8 +58532,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58198,9 +58646,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58240,8 +58689,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58387,8 +58836,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58537,9 +58985,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58578,8 +59026,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58649,8 +59097,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58803,9 +59250,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58844,8 +59291,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58911,9 +59358,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58953,8 +59401,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -59025,8 +59473,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -59143,9 +59590,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59184,8 +59631,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -59251,9 +59698,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59293,8 +59741,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -60324,10 +60772,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -62142,8 +62599,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -62265,9 +62721,10 @@ get names(): ((string | LanguageString))[] { const vs = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62307,8 +62764,8 @@ get names(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -62759,10 +63216,19 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -62793,7 +63259,13 @@ get names(): ((string | LanguageString))[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _pVjLsybKQdmkjuU7MHjiVmNnuj7_href: (URL)[] = []; @@ -63450,10 +63922,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -63813,10 +64294,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -64174,10 +64664,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -64538,10 +65037,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -64898,10 +65406,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -65258,10 +65775,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -65618,10 +66144,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -65976,10 +66511,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -66300,10 +66844,19 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -66661,10 +67214,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -66977,8 +67539,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -67094,9 +67655,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67135,8 +67696,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -67229,8 +67790,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -67345,9 +67905,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67386,8 +67946,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -67706,10 +68266,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -68125,8 +68694,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -68250,9 +68818,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68292,8 +68861,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -68534,10 +69103,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -68897,8 +69475,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -69022,9 +69599,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu const vs = this.#_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -69064,8 +69642,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -69355,10 +69933,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -70616,8 +71203,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -70730,9 +71316,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70771,8 +71357,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -70834,9 +71420,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70876,8 +71463,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -70948,8 +71535,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71066,9 +71652,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -71107,8 +71693,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71174,9 +71760,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71216,8 +71803,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71307,8 +71894,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71443,9 +72029,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71484,8 +72070,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71555,8 +72141,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71688,9 +72273,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71729,8 +72314,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71800,8 +72385,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71919,9 +72503,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71960,8 +72544,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72031,8 +72615,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72153,9 +72736,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72194,8 +72777,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72265,8 +72848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72385,9 +72967,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72426,8 +73008,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72497,8 +73079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72615,9 +73196,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72656,8 +73237,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72727,8 +73308,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72845,9 +73425,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72886,8 +73466,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72957,8 +73537,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73072,9 +73651,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -73114,8 +73694,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73261,8 +73841,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73411,9 +73990,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73452,8 +74031,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73523,8 +74102,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73677,9 +74255,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73718,8 +74296,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73785,9 +74363,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73827,8 +74406,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73899,8 +74478,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -74017,9 +74595,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -74058,8 +74636,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -74125,9 +74703,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74167,8 +74746,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -75198,10 +75777,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -76650,10 +77238,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -77811,8 +78408,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -77925,9 +78521,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77966,8 +78562,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78029,9 +78625,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -78071,8 +78668,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78143,8 +78740,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78261,9 +78857,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78302,8 +78898,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78369,9 +78965,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78411,8 +79008,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78502,8 +79099,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78638,9 +79234,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78679,8 +79275,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78750,8 +79346,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78883,9 +79478,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78924,8 +79519,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78995,8 +79590,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79114,9 +79708,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79155,8 +79749,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79226,8 +79820,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79348,9 +79941,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79389,8 +79982,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79460,8 +80053,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79580,9 +80172,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79621,8 +80213,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79692,8 +80284,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79810,9 +80401,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79851,8 +80442,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79922,8 +80513,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80040,9 +80630,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -80081,8 +80671,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80152,8 +80742,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80267,9 +80856,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80309,8 +80899,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80456,8 +81046,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80606,9 +81195,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80647,8 +81236,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80718,8 +81307,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80872,9 +81460,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80913,8 +81501,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80980,9 +81568,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -81022,8 +81611,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -81094,8 +81683,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -81212,9 +81800,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81253,8 +81841,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -81320,9 +81908,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81362,8 +81951,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -82393,10 +82982,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -84301,10 +84899,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -84798,8 +85405,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -84914,9 +85520,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.length < 1) return null; let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84955,8 +85561,8 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -85195,10 +85801,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -85717,8 +86332,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -85834,9 +86448,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const vs = this.#_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85876,8 +86491,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -85948,8 +86563,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -86065,9 +86679,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti const vs = this.#_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -86107,8 +86722,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -86209,8 +86824,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -86326,9 +86940,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.length < 1) return null; let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86367,8 +86981,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -86461,8 +87075,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -86577,9 +87190,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.length < 1) return null; let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86618,8 +87231,8 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -86921,10 +87534,19 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -87619,10 +88241,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -87979,10 +88610,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -88420,8 +89060,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -88538,9 +89177,9 @@ relationships?: (Object | URL)[];} } if (this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.length < 1) return null; let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88579,8 +89218,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88650,8 +89289,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -88765,9 +89403,9 @@ relationships?: (Object | URL)[];} } if (this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.length < 1) return null; let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88806,8 +89444,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88870,9 +89508,10 @@ relationships?: (Object | URL)[];} const vs = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88912,8 +89551,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88984,8 +89623,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -89101,9 +89739,9 @@ relationships?: (Object | URL)[];} } if (this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.length < 1) return null; let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -89142,8 +89780,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -89208,9 +89846,10 @@ relationships?: (Object | URL)[];} const vs = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89250,8 +89889,8 @@ relationships?: (Object | URL)[];} } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -89561,10 +90200,19 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -90083,10 +90731,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -91244,8 +91901,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -91358,9 +92014,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey.length < 1) return null; let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91399,8 +92055,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91462,9 +92118,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91504,8 +92161,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91576,8 +92233,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -91694,9 +92350,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.length < 1) return null; let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91735,8 +92391,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91802,9 +92458,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91844,8 +92501,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91935,8 +92592,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92071,9 +92727,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.length < 1) return null; let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -92112,8 +92768,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92183,8 +92839,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92316,9 +92971,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox.length < 1) return null; let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92357,8 +93012,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92428,8 +93083,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92547,9 +93201,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.length < 1) return null; let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92588,8 +93242,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92659,8 +93313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92781,9 +93434,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.length < 1) return null; let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92822,8 +93475,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92893,8 +93546,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93013,9 +93665,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.length < 1) return null; let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -93054,8 +93706,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93125,8 +93777,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93243,9 +93894,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured.length < 1) return null; let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93284,8 +93935,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93355,8 +94006,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93473,9 +94123,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.length < 1) return null; let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93514,8 +94164,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93585,8 +94235,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93700,9 +94349,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93742,8 +94392,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93889,8 +94539,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -94039,9 +94688,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.length < 1) return null; let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -94080,8 +94729,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94151,8 +94800,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -94305,9 +94953,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.length < 1) return null; let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94346,8 +94994,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94413,9 +95061,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94455,8 +95104,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94527,8 +95176,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (options.crossOrigin !== "trust" && obj?.id != null && - !haveSameIriOrigin(obj.id, baseUrl)) { + if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -94645,9 +95293,9 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.length < 1) return null; let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94686,8 +95334,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94753,9 +95401,10 @@ get preferredUsernames(): ((string | LanguageString))[] { const vs = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service; for (let i = 0; i < vs.length; i++) { let v = vs[i]; - if (options.crossOrigin !== "trust" && !(v instanceof URL) && + if (!(v instanceof URL) && v.id != null && - (this.id == null || !haveSameIriOrigin(v.id, this.id)) && + (this.id == null || + !hasTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94795,8 +95444,8 @@ get preferredUsernames(): ((string | LanguageString))[] { } } - if (options.crossOrigin !== "trust" && v?.id != null && - this.id != null && !haveSameIriOrigin(v.id, this.id) && + if (v?.id != null && + this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -95826,10 +96475,19 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -97494,10 +98152,19 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -97520,7 +98187,13 @@ get contents(): ((string | LanguageString))[] { } const instance = new this( - { id: values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"], options.baseUrl) ? parseIri(values["@id"], options.baseUrl) : undefined }, + { + id: values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"], options.baseUrl) + ? parseIri(values["@id"], options.baseUrl) + : undefined + }, options, ); const _4HuuRSdSrXq8Jj2J9gcdYfoCzeuz_content: ((string | LanguageString))[] = []; @@ -97952,10 +98625,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -98312,10 +98994,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -98888,10 +99579,19 @@ get formerTypes(): ($EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -99349,10 +100049,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -99714,10 +100423,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -100077,10 +100795,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -100440,10 +101167,19 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } @@ -100799,10 +101535,19 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if (values["@id"] != null && !values["@id"].startsWith("_:") && !canParseIri(values["@id"], options.baseUrl)) { + if ( + values["@id"] != null && + !values["@id"].startsWith("_:") && + !canParseIri(values["@id"], options.baseUrl) + ) { throw new TypeError("Invalid @id: " + values["@id"]); } - if (options.baseUrl == null && values["@id"] != null && !values["@id"].startsWith("_:") && canParseIri(values["@id"])) { + if ( + options.baseUrl == null && + values["@id"] != null && + !values["@id"].startsWith("_:") && + canParseIri(values["@id"]) + ) { options = { ...options, baseUrl: parseIri(values["@id"]) }; } From 5c5f5cc4325817f7967a3fabae1f78cfa04bd39d Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 20:29:32 +0900 Subject: [PATCH 39/55] Avoid repeated JSON-LD id parsing Add a shared JSON-LD id parser that handles blank node ids and rewrites parse failures into the existing Invalid @id error. Generated decoders now reuse that parsed id for base URL assignment and instance creation instead of checking and parsing the same value repeatedly. Also preformat the generated runtime import list at definition time, so the class generator does not need to keep treating it as an array. https://github.com/fedify-dev/fedify/pull/850#discussion_r3511930948 https://github.com/fedify-dev/fedify/pull/850#discussion_r3512365112 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/mod.ts | 1 + packages/vocab-runtime/src/url.test.ts | 18 + packages/vocab-runtime/src/url.ts | 15 + .../src/__snapshots__/class.test.ts.deno.snap | 1463 +++-------------- .../src/__snapshots__/class.test.ts.node.snap | 1463 +++-------------- .../src/__snapshots__/class.test.ts.snap | 1463 +++-------------- packages/vocab-tools/src/class.ts | 8 +- packages/vocab-tools/src/codec.ts | 23 +- 8 files changed, 815 insertions(+), 3639 deletions(-) diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index 7f4cc43bd..f81321ff6 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -57,6 +57,7 @@ export { isValidPublicIPv4Address, isValidPublicIPv6Address, parseIri, + parseJsonLdId, UrlError, validatePublicUrl, } from "./url.ts"; diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 1bfff3b3d..838f2a656 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -8,6 +8,7 @@ import { isValidPublicIPv4Address, isValidPublicIPv6Address, parseIri, + parseJsonLdId, UrlError, validatePublicUrl, } from "./url.ts"; @@ -69,6 +70,23 @@ test("parseIri() preserves existing URL parsing behavior", () => { ok(!canParseIri("ap://not-a-did/actor")); }); +test("parseJsonLdId() parses JSON-LD ids", () => { + deepStrictEqual(parseJsonLdId(undefined), undefined); + deepStrictEqual(parseJsonLdId("_:blank"), undefined); + deepStrictEqual( + parseJsonLdId("/actor", new URL("https://example.com/users/alice")), + new URL("https://example.com/actor"), + ); + deepStrictEqual( + parseJsonLdId("ap://did:key:z6Mkabc/actor"), + new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), + ); + throws(() => parseJsonLdId("/actor"), { + name: "TypeError", + message: "Invalid @id: /actor", + }); +}); + test("parseIri() resolves relative IRIs against portable string bases", () => { ok(canParseIri("/actor", "ap://did:key:z6Mkabc/objects/1")); deepStrictEqual( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 2744cd99a..226a0b256 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -27,6 +27,21 @@ export function canParseIri(iri: string, base?: string | URL): boolean { } } +/** + * Parses a JSON-LD `@id` value as an IRI. + */ +export function parseJsonLdId( + id: string | undefined, + base?: string | URL, +): URL | undefined { + if (id == null || id.startsWith("_:")) return undefined; + try { + return parseIri(id, base); + } catch { + throw new TypeError("Invalid @id: " + id); + } +} + /** * Parses an IRI as a URL, including FEP-ef61 portable ActivityPub IRIs. */ diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index ec7d26e07..df2624f3a 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -8,7 +8,6 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from \\"@opentelemetry/api\\"; import { canParseDecimal, - canParseIri, decodeMultibase, type Decimal, type DocumentLoader, @@ -24,6 +23,7 @@ import { LanguageString, parseDecimal, parseIri, + parseJsonLdId, type RemoteDocument } from \\"@fedify/vocab-runtime\\"; import { @@ -10931,20 +10931,9 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -11223,11 +11212,7 @@ get urls(): ((URL | Link))[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -13549,20 +13534,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -14604,20 +14578,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -17786,20 +17749,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -18646,20 +18598,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -19191,20 +19132,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -19227,11 +19157,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -19825,20 +19751,9 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -19861,11 +19776,7 @@ unit?: string | null;numericalValue?: Decimal | null;} const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -20879,20 +20790,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -21357,20 +21257,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -21990,20 +21879,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -22026,11 +21904,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -22786,20 +22660,9 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -22822,11 +22685,7 @@ get manualApprovals(): (URL)[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -23851,20 +23710,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -24328,20 +24176,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -25289,20 +25126,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -25766,20 +25592,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -26726,20 +26541,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -27203,20 +27007,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -27690,20 +27483,9 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -27730,11 +27512,7 @@ get endpoints(): (URL)[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -28069,20 +27847,9 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -28929,20 +28696,9 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -28965,11 +28721,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -29950,20 +29702,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -29986,11 +29727,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -30884,20 +30621,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -30920,11 +30646,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -31548,20 +31270,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -32169,20 +31880,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -32205,11 +31905,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -33020,20 +32716,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -33056,11 +32741,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -33918,20 +33599,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -34446,20 +34116,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -34821,20 +34480,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -35191,20 +34839,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -40935,20 +40572,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -42394,20 +42020,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -42776,20 +42391,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -43826,20 +43430,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -44496,20 +44089,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -44960,20 +44542,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -45329,20 +44900,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -45704,20 +45264,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -49671,20 +49220,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -51578,20 +51116,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -52099,20 +51626,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -52468,20 +51984,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -52835,20 +52340,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -53671,20 +53165,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -53707,11 +53190,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -54287,20 +53766,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -54657,20 +54125,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -55028,20 +54485,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -60772,20 +60218,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -63216,20 +62651,9 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -63260,11 +62684,7 @@ get names(): ((string | LanguageString))[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -63922,20 +63342,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -64294,20 +63703,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -64664,20 +64062,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -65037,20 +64424,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -65406,20 +64782,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -65775,20 +65140,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -66144,20 +65498,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -66511,20 +65854,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -66844,20 +66176,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -67214,20 +66535,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -68266,20 +67576,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -69103,20 +68402,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -69933,20 +69221,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -75777,20 +75054,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -77238,20 +76504,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -82982,20 +82237,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -84899,20 +84143,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -85801,20 +85034,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -87534,20 +86756,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -88241,20 +87452,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -88610,20 +87810,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -90200,20 +89389,9 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -90731,20 +89909,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -96475,20 +95642,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -98152,20 +97308,9 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -98188,11 +97333,7 @@ get contents(): ((string | LanguageString))[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -98625,20 +97766,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -98994,20 +98124,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -99579,20 +98698,9 @@ get formerTypes(): (\$EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -100049,20 +99157,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -100423,20 +99520,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -100795,20 +99881,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -101167,20 +100242,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -101535,20 +100599,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 49870ef8d..37e5fc300 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -6,7 +6,6 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from \\"@opentelemetry/api\\"; import { canParseDecimal, - canParseIri, decodeMultibase, type Decimal, type DocumentLoader, @@ -22,6 +21,7 @@ import { LanguageString, parseDecimal, parseIri, + parseJsonLdId, type RemoteDocument } from \\"@fedify/vocab-runtime\\"; import { @@ -10929,20 +10929,9 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -11221,11 +11210,7 @@ get urls(): ((URL | Link))[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -13547,20 +13532,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -14602,20 +14576,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -17784,20 +17747,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -18644,20 +18596,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -19189,20 +19130,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -19225,11 +19155,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -19823,20 +19749,9 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -19859,11 +19774,7 @@ unit?: string | null;numericalValue?: Decimal | null;} const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -20877,20 +20788,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -21355,20 +21255,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -21988,20 +21877,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -22024,11 +21902,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -22784,20 +22658,9 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -22820,11 +22683,7 @@ get manualApprovals(): (URL)[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -23849,20 +23708,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -24326,20 +24174,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -25287,20 +25124,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -25764,20 +25590,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -26724,20 +26539,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -27201,20 +27005,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -27688,20 +27481,9 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -27728,11 +27510,7 @@ get endpoints(): (URL)[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -28067,20 +27845,9 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -28927,20 +28694,9 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -28963,11 +28719,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -29948,20 +29700,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -29984,11 +29725,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -30882,20 +30619,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -30918,11 +30644,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -31546,20 +31268,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -32167,20 +31878,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -32203,11 +31903,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -33018,20 +32714,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -33054,11 +32739,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -33916,20 +33597,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -34444,20 +34114,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -34819,20 +34478,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -35189,20 +34837,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -40933,20 +40570,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -42392,20 +42018,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -42774,20 +42389,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -43824,20 +43428,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -44494,20 +44087,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -44958,20 +44540,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -45327,20 +44898,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -45702,20 +45262,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -49669,20 +49218,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -51576,20 +51114,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -52097,20 +51624,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -52466,20 +51982,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -52833,20 +52338,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -53669,20 +53163,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -53705,11 +53188,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -54285,20 +53764,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -54655,20 +54123,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -55026,20 +54483,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -60770,20 +60216,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -63214,20 +62649,9 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -63258,11 +62682,7 @@ get names(): ((string | LanguageString))[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -63920,20 +63340,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -64292,20 +63701,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -64662,20 +64060,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -65035,20 +64422,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -65404,20 +64780,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -65773,20 +65138,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -66142,20 +65496,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -66509,20 +65852,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -66842,20 +66174,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -67212,20 +66533,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -68264,20 +67574,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -69101,20 +68400,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -69931,20 +69219,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -75775,20 +75052,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -77236,20 +76502,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -82980,20 +82235,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -84897,20 +84141,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -85799,20 +85032,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -87532,20 +86754,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -88239,20 +87450,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -88608,20 +87808,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -90198,20 +89387,9 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -90729,20 +89907,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -96473,20 +95640,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -98150,20 +97306,9 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -98186,11 +97331,7 @@ get contents(): ((string | LanguageString))[] { const instance = new this( { - id: values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"], options.baseUrl) - ? parseIri(values[\\"@id\\"], options.baseUrl) - : undefined + id }, options, ); @@ -98623,20 +97764,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -98992,20 +98122,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -99577,20 +98696,9 @@ get formerTypes(): ($EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -100047,20 +99155,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -100421,20 +99518,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -100793,20 +99879,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -101165,20 +100240,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { @@ -101533,20 +100597,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { \\"@id\\"?: string }); } - if ( - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - !canParseIri(values[\\"@id\\"], options.baseUrl) - ) { - throw new TypeError(\\"Invalid @id: \\" + values[\\"@id\\"]); - } - if ( - options.baseUrl == null && - values[\\"@id\\"] != null && - !values[\\"@id\\"].startsWith(\\"_:\\") && - canParseIri(values[\\"@id\\"]) - ) { - options = { ...options, baseUrl: parseIri(values[\\"@id\\"]) }; + const id = parseJsonLdId(values[\\"@id\\"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if (\\"@type\\" in values) { diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 805197e80..41db32f1e 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -8,7 +8,6 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from "@opentelemetry/api"; import { canParseDecimal, - canParseIri, decodeMultibase, type Decimal, type DocumentLoader, @@ -24,6 +23,7 @@ import { LanguageString, parseDecimal, parseIri, + parseJsonLdId, type RemoteDocument } from "@fedify/vocab-runtime"; import { @@ -10931,20 +10931,9 @@ get urls(): ((URL | Link))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -11223,11 +11212,7 @@ get urls(): ((URL | Link))[] { const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -13549,20 +13534,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -14604,20 +14578,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -17786,20 +17749,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -18646,20 +18598,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -19191,20 +19132,9 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -19227,11 +19157,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -19825,20 +19751,9 @@ unit?: string | null;numericalValue?: Decimal | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -19861,11 +19776,7 @@ unit?: string | null;numericalValue?: Decimal | null;} const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -20879,20 +20790,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -21357,20 +21257,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -21990,20 +21879,9 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -22026,11 +21904,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -22786,20 +22660,9 @@ get manualApprovals(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -22822,11 +22685,7 @@ get manualApprovals(): (URL)[] { const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -23851,20 +23710,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -24328,20 +24176,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -25289,20 +25126,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -25766,20 +25592,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -26726,20 +26541,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -27203,20 +27007,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -27690,20 +27483,9 @@ get endpoints(): (URL)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -27730,11 +27512,7 @@ get endpoints(): (URL)[] { const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -28069,20 +27847,9 @@ endpoints?: (URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -28929,20 +28696,9 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -28965,11 +28721,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -29950,20 +29702,9 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -29986,11 +29727,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -30884,20 +30621,9 @@ controller?: Application | Group | Organization | Person | Service | URL | null; // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -30920,11 +30646,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -31548,20 +31270,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -32169,20 +31880,9 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -32205,11 +31905,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -33020,20 +32716,9 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -33056,11 +32741,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -33918,20 +33599,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -34446,20 +34116,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -34821,20 +34480,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -35191,20 +34839,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -40935,20 +40572,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -42394,20 +42020,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -42776,20 +42391,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -43826,20 +43430,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -44496,20 +44089,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -44960,20 +44542,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -45329,20 +44900,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -45704,20 +45264,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -49671,20 +49220,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -51578,20 +51116,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -52099,20 +51626,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -52468,20 +51984,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -52835,20 +52340,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -53671,20 +53165,9 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -53707,11 +53190,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -54287,20 +53766,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -54657,20 +54125,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -55028,20 +54485,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -60772,20 +60218,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -63216,20 +62651,9 @@ get names(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -63260,11 +62684,7 @@ get names(): ((string | LanguageString))[] { const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -63922,20 +63342,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -64294,20 +63703,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -64664,20 +64062,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -65037,20 +64424,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -65406,20 +64782,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -65775,20 +65140,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -66144,20 +65498,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -66511,20 +65854,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -66844,20 +66176,9 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -67214,20 +66535,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -68266,20 +67576,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -69103,20 +68402,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -69933,20 +69221,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -75777,20 +75054,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -77238,20 +76504,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -82982,20 +82237,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -84899,20 +84143,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -85801,20 +85034,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -87534,20 +86756,9 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -88241,20 +87452,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -88610,20 +87810,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -90200,20 +89389,9 @@ relationships?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -90731,20 +89909,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -96475,20 +95642,9 @@ get preferredUsernames(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -98152,20 +97308,9 @@ get contents(): ((string | LanguageString))[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -98188,11 +97333,7 @@ get contents(): ((string | LanguageString))[] { const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); @@ -98625,20 +97766,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -98994,20 +98124,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -99579,20 +98698,9 @@ get formerTypes(): ($EntityType)[] { // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -100049,20 +99157,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -100423,20 +99520,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -100795,20 +99881,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -101167,20 +100242,9 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { @@ -101535,20 +100599,9 @@ instruments?: (Object | URL)[];} // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } if ("@type" in values) { diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 1d463936d..7fd62ec23 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -14,7 +14,6 @@ const XSD_ANY_URI = "http://www.w3.org/2001/XMLSchema#anyURI"; const FEDIFY_URL = "fedify:url"; const RUNTIME_IMPORTS = [ "canParseDecimal", - "canParseIri", "decodeMultibase", "type Decimal", "type DocumentLoader", @@ -30,8 +29,9 @@ const RUNTIME_IMPORTS = [ "LanguageString", "parseDecimal", "parseIri", + "parseJsonLdId", "type RemoteDocument", -]; +].join(",\n "); /** * Sorts the given types topologically so that the base types come before the @@ -244,9 +244,7 @@ export async function* generateClasses( yield 'import { getLogger } from "@logtape/logtape";\n'; yield `import { type Span, SpanStatusCode, type TracerProvider, trace } from "@opentelemetry/api";\n`; - yield `import {\n ${ - RUNTIME_IMPORTS.join(",\n ") - }\n} from "@fedify/vocab-runtime";\n`; + yield `import {\n ${RUNTIME_IMPORTS}\n} from "@fedify/vocab-runtime";\n`; yield `import { isTemporalDuration, isTemporalInstant, diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 08b3fe245..0e5d598b6 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -406,20 +406,9 @@ export async function* generateDecoder( // deno-lint-ignore no-explicit-any (expanded[0] ?? {}) as (Record & { "@id"?: string }); } - if ( - values["@id"] != null && - !values["@id"].startsWith("_:") && - !canParseIri(values["@id"], options.baseUrl) - ) { - throw new TypeError("Invalid @id: " + values["@id"]); - } - if ( - options.baseUrl == null && - values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"]) - ) { - options = { ...options, baseUrl: parseIri(values["@id"]) }; + const id = parseJsonLdId(values["@id"], options.baseUrl); + if (id != null && options.baseUrl == null) { + options = { ...options, baseUrl: id }; } `; const subtypes = getSubtypes(typeUri, types, true); @@ -455,11 +444,7 @@ export async function* generateDecoder( yield ` const instance = new this( { - id: values["@id"] != null && - !values["@id"].startsWith("_:") && - canParseIri(values["@id"], options.baseUrl) - ? parseIri(values["@id"], options.baseUrl) - : undefined + id }, options, ); From d8f4893fcbe4c2d8e3e804f03aa14849e425e6ce Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 20:47:59 +0900 Subject: [PATCH 40/55] Preserve portable IRI cache edges Normalize portable URL instances before comparing IRI origins, so accepted ap: and ap+ef61: spellings for the same DID authority are treated as same-origin. Also preserve nested unmapped compact JSON-LD terms when recompacting cache data after portable IRI normalization. This keeps extension properties on embedded objects from being dropped. https://github.com/fedify-dev/fedify/pull/850#discussion_r3512705166 https://github.com/fedify-dev/fedify/pull/850#discussion_r3512705170 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 4 +++ packages/vocab-runtime/src/url.ts | 1 + .../src/__snapshots__/class.test.ts.deno.snap | 12 ++++++++ .../src/__snapshots__/class.test.ts.node.snap | 12 ++++++++ .../src/__snapshots__/class.test.ts.snap | 12 ++++++++ packages/vocab-tools/src/class.ts | 12 ++++++++ packages/vocab/src/vocab.test.ts | 29 +++++++++++++++++++ 7 files changed, 82 insertions(+) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 838f2a656..df0febdc8 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -141,6 +141,10 @@ test("haveSameIriOrigin() compares portable IRI authorities", () => { parseIri("ap://did:key:z6Mkabc/actor"), parseIri("ap://did:key:z6Mkabc/outbox"), )); + ok(haveSameIriOrigin( + new URL("ap://did%3Akey%3Az6Mkabc/actor"), + new URL("ap+ef61://did%3Akey%3Az6Mkabc/outbox"), + )); ok( !haveSameIriOrigin( parseIri("ap://did:key:z6Mkabc/actor"), diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 226a0b256..01d32c6f4 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -82,6 +82,7 @@ export function haveSameIriOrigin(left: URL, right: URL): boolean { } function getComparableIriOrigin(iri: URL): string { + iri = normalizePortableUrl(iri) ?? iri; if (iri.origin !== "null") return iri.origin; if (iri.host !== "") return `${iri.protocol}//${iri.host}`; return iri.href; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index df2624f3a..7f5f2b072 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -326,6 +326,18 @@ function preserveJsonLdArrayShape( clone[key] = shaped; } } + if (depth > 0) { + for (const key of globalThis.Object.keys(originalObject)) { + if ( + key.startsWith(\\"@\\") || + globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) + ) { + continue; + } + clone ??= { ...compactedObject }; + clone[key] = structuredClone(originalObject[key]); + } + } return clone ?? compactedObject; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 37e5fc300..de4abd5e0 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -324,6 +324,18 @@ function preserveJsonLdArrayShape( clone[key] = shaped; } } + if (depth > 0) { + for (const key of globalThis.Object.keys(originalObject)) { + if ( + key.startsWith(\\"@\\") || + globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) + ) { + continue; + } + clone ??= { ...compactedObject }; + clone[key] = structuredClone(originalObject[key]); + } + } return clone ?? compactedObject; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 41db32f1e..635c62dc6 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -326,6 +326,18 @@ function preserveJsonLdArrayShape( clone[key] = shaped; } } + if (depth > 0) { + for (const key of globalThis.Object.keys(originalObject)) { + if ( + key.startsWith("@") || + globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) + ) { + continue; + } + clone ??= { ...compactedObject }; + clone[key] = structuredClone(originalObject[key]); + } + } return clone ?? compactedObject; } diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index 7fd62ec23..c8f6aabda 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -546,6 +546,18 @@ function hasTrustedIriOrigin( clone[key] = shaped; } } + if (depth > 0) { + for (const key of globalThis.Object.keys(originalObject)) { + if ( + key.startsWith("@") || + globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) + ) { + continue; + } + clone ??= { ...compactedObject }; + clone[key] = structuredClone(originalObject[key]); + } + } return clone ?? compactedObject; }\n\n`; const moduleVarNames = new Map(); diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 9baa8ccec..c796cc856 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -869,6 +869,35 @@ test("fromJsonLd() preserves compact multi-node arrays with portable IRIs", asyn ]); }); +test("fromJsonLd() preserves nested unmapped terms with portable IRIs", async () => { + const noteJson = { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: "ap://did:key:z6Mkabc/objects/1", + attachment: { + type: "Object", + name: "Attachment with an unmapped extension.", + extra: "This nested unmapped property should stay cached.", + }, + }; + + const note = await Note.fromJsonLd(noteJson, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await note.toJsonLd(), { + "@context": "https://www.w3.org/ns/activitystreams", + type: "Note", + id: "ap+ef61://did:key:z6Mkabc/objects/1", + attachment: { + type: "Object", + name: "Attachment with an unmapped extension.", + extra: "This nested unmapped property should stay cached.", + }, + }); +}); + test("fromJsonLd() preserves compact array item extension contexts with portable IRIs", async () => { const activityJson = [ { From 48c1aad2272210bfe693a721c8f3a3ac641a8588 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 22:19:19 +0900 Subject: [PATCH 41/55] Move JSON-LD cache helpers to runtime Keep generated vocabulary classes focused on schema-specific constants by importing reusable JSON-LD cache and IRI trust helpers from @fedify/vocab-runtime. The generated code now only emits the portable IRI key set and pattern, then passes them to the runtime normalization helper. This also gives the cache compaction and IRI normalization paths direct unit coverage outside generated snapshots. https://github.com/fedify-dev/fedify/pull/850#pullrequestreview-4616181669 Assisted-by: Codex:gpt-5.5 --- .../vocab-runtime/src/jsonld-cache.test.ts | 94 + packages/vocab-runtime/src/jsonld-cache.ts | 312 +++ packages/vocab-runtime/src/mod.ts | 7 + .../src/__snapshots__/class.test.ts.deno.snap | 1781 +++++++++-------- .../src/__snapshots__/class.test.ts.node.snap | 1781 +++++++++-------- .../src/__snapshots__/class.test.ts.snap | 1781 +++++++++-------- packages/vocab-tools/src/class.ts | 306 +-- packages/vocab-tools/src/codec.ts | 6 +- packages/vocab-tools/src/property.ts | 10 +- 9 files changed, 3127 insertions(+), 2951 deletions(-) create mode 100644 packages/vocab-runtime/src/jsonld-cache.test.ts create mode 100644 packages/vocab-runtime/src/jsonld-cache.ts diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts new file mode 100644 index 000000000..6cff4c13a --- /dev/null +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -0,0 +1,94 @@ +import { deepStrictEqual, ok } from "node:assert"; +import { test } from "node:test"; +import { + compactJsonLdCache, + getJsonLdContext, + isTrustedIriOrigin, + normalizeJsonLdIris, +} from "./jsonld-cache.ts"; +import jsonld from "./jsonld.ts"; +import { parseIri } from "./url.ts"; + +test("isTrustedIriOrigin() trusts same portable IRI origins", () => { + ok(isTrustedIriOrigin( + {}, + parseIri("ap://did:key:z6Mkabc/actor"), + parseIri("ap+ef61://did:key:z6Mkabc/outbox"), + )); + ok( + !isTrustedIriOrigin( + {}, + parseIri("ap://did:key:z6Mkabc/actor"), + parseIri("ap://did:key:z6Mkdef/outbox"), + ), + ); + ok(isTrustedIriOrigin( + { crossOrigin: "trust" }, + parseIri("ap://did:key:z6Mkabc/actor"), + parseIri("ap://did:key:z6Mkdef/outbox"), + )); +}); + +test("normalizeJsonLdIris() normalizes selected JSON-LD IRI positions", () => { + const iriKeys = new Set(["@id", "https://example.com/ns#ref"]); + const value = { + "@id": "ap://did:key:z6Mkabc/object", + "https://example.com/ns#ref": [ + { "@value": "ap://did:key:z6Mkabc/ref" }, + ], + "https://example.com/ns#text": [ + { "@value": "ap://did:key:z6Mkabc/not-an-iri-position" }, + ], + }; + + deepStrictEqual(normalizeJsonLdIris(value, iriKeys), { + "@id": "ap+ef61://did:key:z6Mkabc/object", + "https://example.com/ns#ref": [ + { "@value": "ap+ef61://did:key:z6Mkabc/ref" }, + ], + "https://example.com/ns#text": [ + { "@value": "ap://did:key:z6Mkabc/not-an-iri-position" }, + ], + }); +}); + +test("getJsonLdContext() finds nested contexts", () => { + const context = { name: "https://example.com/ns#name" }; + deepStrictEqual( + getJsonLdContext([{ type: "Note" }, { "@context": context }]), + context, + ); +}); + +test("compactJsonLdCache() preserves nested unmapped terms", async () => { + const context = { + as: "https://www.w3.org/ns/activitystreams#", + id: "@id", + type: "@type", + attachment: { "@id": "as:attachment" }, + name: "as:name", + }; + const original = { + "@context": context, + type: "as:Note", + id: "ap://did:key:z6Mkabc/objects/1", + attachment: { + type: "as:Object", + name: "Attachment with an unmapped extension.", + extra: "This nested unmapped property should stay cached.", + }, + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + + deepStrictEqual(await compactJsonLdCache(normalized, original), { + "@context": context, + type: "as:Note", + id: "ap+ef61://did:key:z6Mkabc/objects/1", + attachment: { + type: "as:Object", + name: "Attachment with an unmapped extension.", + extra: "This nested unmapped property should stay cached.", + }, + }); +}); diff --git a/packages/vocab-runtime/src/jsonld-cache.ts b/packages/vocab-runtime/src/jsonld-cache.ts new file mode 100644 index 000000000..a6c5f9d6c --- /dev/null +++ b/packages/vocab-runtime/src/jsonld-cache.ts @@ -0,0 +1,312 @@ +import type { DocumentLoader } from "./docloader.ts"; +import jsonld from "./jsonld.ts"; +import { formatIri, haveSameIriOrigin } from "./url.ts"; + +/** + * Options for deciding whether two IRIs should be treated as same-origin. + */ +export interface IriTrustOptions { + crossOrigin?: "ignore" | "throw" | "trust"; +} + +/** + * Checks whether an IRI is trusted relative to another IRI. + */ +export function isTrustedIriOrigin( + options: IriTrustOptions, + left: URL | null | undefined, + right: URL | null | undefined, +): boolean { + return options.crossOrigin === "trust" || left == null || + (right != null && haveSameIriOrigin(left, right)); +} + +/** + * Normalizes portable IRIs in JSON-LD cache data. + */ +export function normalizeJsonLdIris( + value: unknown, + iriKeys: ReadonlySet, + iriPattern: RegExp = /^ap(?:\+ef61)?:\/\//i, +): unknown { + return normalize(value, undefined, 0, undefined); + + function isIriPosition(key: string, parentKey?: string): boolean { + return iriKeys.has(key) || + ((key === "@value" || key === "@list" || key === "@set") && + parentKey != null && iriKeys.has(parentKey)); + } + + function normalize( + value: unknown, + key?: string, + depth = 0, + parentKey?: string, + ): unknown { + if (depth > 32 || key === "@context") return value; + if (typeof value === "string") { + if ( + key != null && isIriPosition(key, parentKey) && iriPattern.test(value) + ) { + try { + return formatIri(value); + } catch { + return value; + } + } + return value; + } + if (Array.isArray(value)) { + let clone: unknown[] | undefined; + for (let i = 0; i < value.length; i++) { + const result = normalize(value[i], key, depth + 1, parentKey); + if (result !== value[i]) { + clone ??= value.slice(0, i); + clone.push(result); + } else if (clone != null) { + clone.push(value[i]); + } + } + return clone ?? value; + } + if (value == null || typeof value !== "object") return value; + const object = value as Record; + let clone: Record | undefined; + for (const entryKey of globalThis.Object.keys(object)) { + const result = normalize(object[entryKey], entryKey, depth + 1, key); + if (result !== object[entryKey]) { + clone ??= { ...object }; + clone[entryKey] = result; + } + } + return clone ?? object; + } +} + +/** + * Finds the first JSON-LD context in a value. + */ +export function getJsonLdContext(value: unknown, depth = 0): unknown { + if (depth > 32) return undefined; + if (Array.isArray(value)) { + for (const item of value) { + const context = getJsonLdContext(item, depth + 1); + if (context !== undefined) return context; + } + return undefined; + } + if ( + value == null || typeof value !== "object" || + !("@context" in value) + ) { + return undefined; + } + return (value as Record)["@context"]; +} + +/** + * Recompacts normalized JSON-LD cache data against the original context. + */ +export async function compactJsonLdCache( + normalized: unknown, + original: unknown, + documentLoader?: DocumentLoader, + depth = 0, +): Promise { + if (depth > 32) return normalized; + if (Array.isArray(original)) { + const normalizedArray = Array.isArray(normalized) + ? normalized + : normalized != null && typeof normalized === "object" && + "@graph" in normalized && + Array.isArray((normalized as Record)["@graph"]) + ? (normalized as Record)["@graph"] as unknown[] + : undefined; + if (normalizedArray == null) return normalized; + let clone: unknown[] | undefined; + for (let i = 0; i < normalizedArray.length; i++) { + const item = await compactJsonLdCache( + normalizedArray[i], + original[i], + documentLoader, + depth + 1, + ); + if (item !== normalizedArray[i]) { + clone ??= normalizedArray.slice(0, i); + clone.push(item); + } else if (clone != null) { + clone.push(normalizedArray[i]); + } + } + return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); + } + const context = getJsonLdContext(original); + if (context == null) return normalized; + return preserveJsonLdShape( + await mergeUnmappedTerms( + await jsonld.compact( + Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized, + context, + { documentLoader }, + ), + original, + context, + documentLoader, + ), + original, + ); +} + +function getTopLevelTerms(value: unknown): ReadonlySet { + const terms = new Set(); + const nodes = Array.isArray(value) ? value : [value]; + for (const node of nodes) { + if (node == null || typeof node !== "object" || Array.isArray(node)) { + continue; + } + for (const key of globalThis.Object.keys(node)) { + if (key.startsWith("@")) continue; + terms.add(key); + } + } + return terms; +} + +async function mergeUnmappedTerms( + compacted: unknown, + original: unknown, + context: unknown, + documentLoader?: DocumentLoader, +): Promise { + if ( + original == null || typeof original !== "object" || + Array.isArray(original) || + compacted == null || typeof compacted !== "object" || + Array.isArray(compacted) + ) { + return compacted; + } + const result = { ...compacted as Record }; + const unmappedKeys = globalThis.Object.keys(original).filter((key) => + key !== "@context" && + !globalThis.Object.prototype.hasOwnProperty.call(result, key) + ); + if (unmappedKeys.length < 1) return result; + const compactedTerms = getTopLevelTerms( + await jsonld.expand(compacted, { + documentLoader, + }), + ); + const dummyPrefix = "urn:fedify:dummy:"; + const dummy: Record = { "@context": context }; + for (let i = 0; i < unmappedKeys.length; i++) { + dummy[unmappedKeys[i]] = `${dummyPrefix}${i}`; + } + const expanded = await jsonld.expand(dummy, { documentLoader }); + const representedKeys = new Set(); + const nodes = Array.isArray(expanded) ? expanded : [expanded]; + for (const node of nodes) { + if (node == null || typeof node !== "object" || Array.isArray(node)) { + continue; + } + for (const [term, termValue] of globalThis.Object.entries(node)) { + if (!compactedTerms.has(term)) continue; + const value = JSON.stringify(termValue); + for (let i = 0; i < unmappedKeys.length; i++) { + if (value.includes(`${dummyPrefix}${i}`)) { + representedKeys.add(unmappedKeys[i]); + } + } + } + } + for (const key of unmappedKeys) { + if (!representedKeys.has(key)) { + result[key] = structuredClone( + (original as Record)[key], + ); + } + } + return result; +} + +function preserveJsonLdShape( + compacted: unknown, + original: unknown, + depth = 0, +): unknown { + if (depth > 32) return compacted; + if ( + original == null || typeof original !== "object" || + compacted == null || typeof compacted !== "object" + ) { + return compacted; + } + if (Array.isArray(original)) { + const compactedArray = Array.isArray(compacted) + ? compacted + : "@graph" in compacted && + Array.isArray((compacted as Record)["@graph"]) + ? (compacted as Record)["@graph"] as unknown[] + : undefined; + if (compactedArray == null) return compacted; + let clone: unknown[] | undefined; + for (let i = 0; i < compactedArray.length; i++) { + const value = preserveJsonLdShape( + compactedArray[i], + original[i], + depth + 1, + ); + const originalContext = original[i] != null && + typeof original[i] === "object" && !Array.isArray(original[i]) && + "@context" in original[i] + ? (original[i] as Record)["@context"] + : undefined; + const shaped = originalContext !== undefined && + value != null && typeof value === "object" && + !Array.isArray(value) && !("@context" in value) + ? { "@context": originalContext, ...value as Record } + : value; + if (shaped !== compactedArray[i]) { + clone ??= compactedArray.slice(0, i); + clone.push(shaped); + } else if (clone != null) { + clone.push(compactedArray[i]); + } + } + return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); + } + if (Array.isArray(compacted)) return compacted; + let clone: Record | undefined; + const compactedObject = compacted as Record; + const originalObject = original as Record; + for (const key of globalThis.Object.keys(compactedObject)) { + if (key === "@context") continue; + const value = preserveJsonLdShape( + compactedObject[key], + originalObject[key], + depth + 1, + ); + const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) + ? [value] + : value; + if (shaped !== compactedObject[key]) { + clone ??= { ...compactedObject }; + clone[key] = shaped; + } + } + if (depth > 0) { + for (const key of globalThis.Object.keys(originalObject)) { + if ( + key.startsWith("@") || + globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) + ) { + continue; + } + clone ??= { ...compactedObject }; + clone[key] = structuredClone(originalObject[key]); + } + } + return clone ?? compactedObject; +} diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index f81321ff6..f45d3a5c4 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -61,3 +61,10 @@ export { UrlError, validatePublicUrl, } from "./url.ts"; +export { + compactJsonLdCache, + getJsonLdContext, + type IriTrustOptions, + isTrustedIriOrigin, + normalizeJsonLdIris, +} from "./jsonld-cache.ts"; diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 7f5f2b072..feabdcf37 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -8,6 +8,7 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from \\"@opentelemetry/api\\"; import { canParseDecimal, + compactJsonLdCache, decodeMultibase, type Decimal, type DocumentLoader, @@ -16,11 +17,13 @@ import { exportSpki, formatIri, getDocumentLoader, - haveSameIriOrigin, + getJsonLdContext, importMultibaseKey, importPem, isDecimal, + isTrustedIriOrigin, LanguageString, + normalizeJsonLdIris, parseDecimal, parseIri, parseJsonLdId, @@ -30,317 +33,9 @@ import { isTemporalDuration, isTemporalInstant, } from \\"@fedify/vocab-runtime/temporal\\"; - - -function hasTrustedIriOrigin( - options: { crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\" }, - left: URL | null | undefined, - right: URL | null | undefined, -): boolean { - return options.crossOrigin === \\"trust\\" || left == null || - (right != null && haveSameIriOrigin(left, right)); -} - const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function isPortableIriValuePosition( - key: string, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): boolean { - return portableIriKeys.has(key) || - ((key === \\"@value\\" || key === \\"@list\\" || key === \\"@set\\") && - parentKey != null && portableIriKeys.has(parentKey)); -} - -function formatPortableIriForCache(value: string): string { - try { - return formatIri(value); - } catch { - return value; - } -} - -function normalizePortableIris( - value: unknown, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): unknown { - if (depth > 32 || key === \\"@context\\") return value; - if (typeof value === \\"string\\") { - if ( - key != null && - isPortableIriValuePosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ) { - return formatPortableIriForCache(value); - } - return value; - } - if (Array.isArray(value)) { - let clone: unknown[] | undefined; - for (let i = 0; i < value.length; i++) { - const result = normalizePortableIris( - value[i], - key, - depth + 1, - parentKey, - portableIriKeys, - ); - if (result !== value[i]) { - clone ??= value.slice(0, i); - clone.push(result); - } else if (clone != null) { - clone.push(value[i]); - } - } - return clone ?? value; - } - if (value == null || typeof value !== \\"object\\") { - return value; - } - const object = value as Record; - let clone: Record | undefined; - for (const entryKey of globalThis.Object.keys(object)) { - const result = normalizePortableIris( - object[entryKey], - entryKey, - depth + 1, - key, - portableIriKeys, - ); - if (result !== object[entryKey]) { - clone ??= { ...object }; - clone[entryKey] = result; - } - } - return clone ?? object; -} - -function getJsonLdContext(value: unknown, depth = 0): unknown { - if (depth > 32) return undefined; - if (Array.isArray(value)) { - for (const item of value) { - const context = getJsonLdContext(item, depth + 1); - if (context !== undefined) return context; - } - return undefined; - } - if ( - value == null || typeof value !== \\"object\\" || - !(\\"@context\\" in value) - ) { - return undefined; - } - return (value as Record)[\\"@context\\"]; -} - -async function compactJsonLdCache( - normalized: unknown, - original: unknown, - documentLoader?: DocumentLoader, - depth = 0, -): Promise { - if (depth > 32) return normalized; - if (Array.isArray(original)) { - const normalizedArray = Array.isArray(normalized) - ? normalized - : normalized != null && typeof normalized === \\"object\\" && - \\"@graph\\" in normalized && - Array.isArray((normalized as Record)[\\"@graph\\"]) - ? (normalized as Record)[\\"@graph\\"] as unknown[] - : undefined; - if (normalizedArray == null) return normalized; - let clone: unknown[] | undefined; - for (let i = 0; i < normalizedArray.length; i++) { - const item = await compactJsonLdCache( - normalizedArray[i], - original[i], - documentLoader, - depth + 1, - ); - if (item !== normalizedArray[i]) { - clone ??= normalizedArray.slice(0, i); - clone.push(item); - } else if (clone != null) { - clone.push(normalizedArray[i]); - } - } - return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); - } - const context = getJsonLdContext(original); - if (context == null) return normalized; - return preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader, - }, - ), - original, - context, - documentLoader, - ), - original, - ); -} - -function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { - const terms = new Set(); - const nodes = Array.isArray(value) ? value : [value]; - for (const node of nodes) { - if (node == null || typeof node !== \\"object\\" || Array.isArray(node)) { - continue; - } - for (const key of globalThis.Object.keys(node)) { - if (key.startsWith(\\"@\\")) continue; - terms.add(key); - } - } - return terms; -} - -async function mergeUnmappedJsonLdTerms( - compacted: unknown, - original: unknown, - context: unknown, - documentLoader?: DocumentLoader, -): Promise { - if ( - original == null || typeof original !== \\"object\\" || - Array.isArray(original) || - compacted == null || typeof compacted !== \\"object\\" || - Array.isArray(compacted) - ) { - return compacted; - } - const result = { ...compacted as Record }; - const unmappedKeys = globalThis.Object.keys(original).filter((key) => - key !== \\"@context\\" && - !globalThis.Object.prototype.hasOwnProperty.call(result, key) - ); - if (unmappedKeys.length < 1) return result; - const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { - documentLoader, - })); - const dummyPrefix = \\"urn:fedify:dummy:\\"; - const dummy: Record = { \\"@context\\": context }; - for (let i = 0; i < unmappedKeys.length; i++) { - dummy[unmappedKeys[i]] = \`\${dummyPrefix}\${i}\`; - } - const expanded = await jsonld.expand(dummy, { documentLoader }); - const representedKeys = new Set(); - const nodes = Array.isArray(expanded) ? expanded : [expanded]; - for (const node of nodes) { - if (node == null || typeof node !== \\"object\\" || Array.isArray(node)) { - continue; - } - for (const [term, termValue] of globalThis.Object.entries(node)) { - if (!compactedTerms.has(term)) continue; - const value = JSON.stringify(termValue); - for (let i = 0; i < unmappedKeys.length; i++) { - if (value.includes(\`\${dummyPrefix}\${i}\`)) { - representedKeys.add(unmappedKeys[i]); - } - } - } - } - for (const key of unmappedKeys) { - if (!representedKeys.has(key)) { - const value = (original as Record)[key]; - result[key] = structuredClone(value); - } - } - return result; -} - -function preserveJsonLdArrayShape( - compacted: unknown, - original: unknown, - depth = 0, -): unknown { - if (depth > 32) return compacted; - if ( - original == null || typeof original !== \\"object\\" || - compacted == null || typeof compacted !== \\"object\\" - ) { - return compacted; - } - if (Array.isArray(original)) { - const compactedArray = Array.isArray(compacted) - ? compacted - : \\"@graph\\" in compacted && - Array.isArray((compacted as Record)[\\"@graph\\"]) - ? (compacted as Record)[\\"@graph\\"] as unknown[] - : undefined; - if (compactedArray == null) return compacted; - let clone: unknown[] | undefined; - for (let i = 0; i < compactedArray.length; i++) { - const value = preserveJsonLdArrayShape( - compactedArray[i], - original[i], - depth + 1, - ); - const originalContext = original[i] != null && - typeof original[i] === \\"object\\" && !Array.isArray(original[i]) && - \\"@context\\" in original[i] - ? (original[i] as Record)[\\"@context\\"] - : undefined; - const shaped = originalContext !== undefined && - value != null && typeof value === \\"object\\" && - !Array.isArray(value) && !(\\"@context\\" in value) - ? { \\"@context\\": originalContext, ...value as Record } - : value; - if (shaped !== compactedArray[i]) { - clone ??= compactedArray.slice(0, i); - clone.push(shaped); - } else if (clone != null) { - clone.push(compactedArray[i]); - } - } - return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); - } - if (Array.isArray(compacted)) return compacted; - let clone: Record | undefined; - const compactedObject = compacted as Record; - const originalObject = original as Record; - for (const key of globalThis.Object.keys(compactedObject)) { - if (key === \\"@context\\") continue; - const value = preserveJsonLdArrayShape( - compactedObject[key], - originalObject[key], - depth + 1, - ); - const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) - ? [value] - : value; - if (shaped !== compactedObject[key]) { - clone ??= { ...compactedObject }; - clone[key] = shaped; - } - } - if (depth > 0) { - for (const key of globalThis.Object.keys(originalObject)) { - if ( - key.startsWith(\\"@\\") || - globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) - ) { - continue; - } - clone ??= { ...compactedObject }; - clone[key] = structuredClone(originalObject[key]); - } - } - return clone ?? compactedObject; -} - import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -2495,7 +2190,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2632,7 +2327,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2673,7 +2368,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2744,7 +2439,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2898,7 +2593,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2938,7 +2633,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3006,7 +2701,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3047,7 +2742,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3118,7 +2813,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3235,7 +2930,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3275,7 +2970,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3342,7 +3037,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3383,7 +3078,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3483,7 +3178,7 @@ get contents(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3615,7 +3310,7 @@ get contents(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3656,7 +3351,7 @@ get contents(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3769,7 +3464,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3895,7 +3590,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3936,7 +3631,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4007,7 +3702,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4146,7 +3841,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4186,7 +3881,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4254,7 +3949,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4295,7 +3990,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4366,7 +4061,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4505,7 +4200,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4545,7 +4240,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4613,7 +4308,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4654,7 +4349,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4725,7 +4420,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4851,7 +4546,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4891,7 +4586,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4958,7 +4653,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4999,7 +4694,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5070,7 +4765,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5196,7 +4891,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5236,7 +4931,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5303,7 +4998,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5344,7 +5039,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5415,7 +5110,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5540,7 +5235,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5580,7 +5275,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5646,7 +5341,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5687,7 +5382,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5771,7 +5466,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5888,7 +5583,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5928,7 +5623,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5998,7 +5693,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6121,7 +5816,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6161,7 +5856,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6231,7 +5926,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6354,7 +6049,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6394,7 +6089,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6464,7 +6159,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6581,7 +6276,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6621,7 +6316,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6731,7 +6426,7 @@ get summaries(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6860,7 +6555,7 @@ get summaries(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6901,7 +6596,7 @@ get summaries(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7006,7 +6701,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7123,7 +6818,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7163,7 +6858,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7230,7 +6925,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7271,7 +6966,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7342,7 +7037,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7459,7 +7154,7 @@ get urls(): ((URL | Link))[] { let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7499,7 +7194,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7566,7 +7261,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7607,7 +7302,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7678,7 +7373,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7795,7 +7490,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7835,7 +7530,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7902,7 +7597,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7943,7 +7638,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8014,7 +7709,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8131,7 +7826,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8171,7 +7866,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8238,7 +7933,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8279,7 +7974,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8414,7 +8109,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8530,7 +8225,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8570,7 +8265,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8636,7 +8331,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8677,7 +8372,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8787,7 +8482,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8904,7 +8599,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8944,7 +8639,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -9014,7 +8709,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9131,7 +8826,7 @@ get urls(): ((URL | Link))[] { let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9171,7 +8866,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -9241,7 +8936,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9358,7 +9053,7 @@ get urls(): ((URL | Link))[] { let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9398,7 +9093,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -11216,7 +10911,11 @@ get urls(): ((URL | Link))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -13563,7 +13262,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -13863,7 +13566,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -13981,7 +13684,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -14021,7 +13724,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14114,7 +13817,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -14231,7 +13934,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14271,7 +13974,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14607,7 +14310,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -15484,7 +15191,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15638,7 +15345,7 @@ instruments?: (Object | URL)[];} let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15678,7 +15385,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15746,7 +15453,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15787,7 +15494,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15858,7 +15565,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15976,7 +15683,7 @@ instruments?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -16016,7 +15723,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16084,7 +15791,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16125,7 +15832,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16196,7 +15903,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16317,7 +16024,7 @@ instruments?: (Object | URL)[];} let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16357,7 +16064,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16428,7 +16135,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16469,7 +16176,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16540,7 +16247,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16658,7 +16365,7 @@ instruments?: (Object | URL)[];} let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16698,7 +16405,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16766,7 +16473,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16807,7 +16514,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16878,7 +16585,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16997,7 +16704,7 @@ instruments?: (Object | URL)[];} let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -17037,7 +16744,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17106,7 +16813,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17147,7 +16854,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17218,7 +16925,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -17335,7 +17042,7 @@ instruments?: (Object | URL)[];} let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17375,7 +17082,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17442,7 +17149,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17483,7 +17190,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17914,7 +17621,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -18627,7 +18338,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -19161,7 +18876,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -19780,7 +19499,11 @@ unit?: string | null;numericalValue?: Decimal | null;} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -20145,7 +19868,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20262,7 +19985,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20302,7 +20025,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20372,7 +20095,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20488,7 +20211,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20528,7 +20251,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20819,7 +20542,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -21286,7 +21013,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -21908,7 +21639,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -22689,7 +22424,11 @@ get manualApprovals(): (URL)[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -23065,7 +22804,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23182,7 +22921,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23222,7 +22961,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23292,7 +23031,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23408,7 +23147,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23448,7 +23187,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23739,7 +23478,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -24205,7 +23948,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -24481,7 +24228,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24598,7 +24345,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24638,7 +24385,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -24708,7 +24455,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24824,7 +24571,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24864,7 +24611,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -25155,7 +24902,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -25621,7 +25372,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -25897,7 +25652,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26013,7 +25768,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26053,7 +25808,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26123,7 +25878,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26239,7 +25994,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26279,7 +26034,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26570,7 +26325,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27036,7 +26795,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27516,7 +27279,11 @@ get endpoints(): (URL)[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27876,7 +27643,11 @@ endpoints?: (URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -28279,7 +28050,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -28398,7 +28169,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28413,7 +28184,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -28725,7 +28496,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -29251,7 +29026,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -29402,7 +29177,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29442,7 +29217,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -29731,7 +29506,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -30163,7 +29942,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -30314,7 +30093,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30354,7 +30133,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -30650,7 +30429,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -31299,7 +31082,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -31909,7 +31696,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -32745,7 +32536,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -33628,7 +33423,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34149,7 +33948,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34509,7 +34312,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34868,7 +34675,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -36010,7 +35821,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36125,7 +35936,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36165,7 +35976,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36230,7 +36041,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36271,7 +36082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36342,7 +36153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36461,7 +36272,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36501,7 +36312,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36570,7 +36381,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36611,7 +36422,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36701,7 +36512,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36838,7 +36649,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36878,7 +36689,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36948,7 +36759,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37082,7 +36893,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37122,7 +36933,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37192,7 +37003,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37312,7 +37123,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37352,7 +37163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37422,7 +37233,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37545,7 +37356,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37585,7 +37396,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37655,7 +37466,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37776,7 +37587,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37816,7 +37627,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37886,7 +37697,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38005,7 +37816,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38045,7 +37856,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38115,7 +37926,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38234,7 +38045,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38274,7 +38085,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38344,7 +38155,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38461,7 +38272,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38502,7 +38313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38648,7 +38459,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38799,7 +38610,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38839,7 +38650,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38909,7 +38720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39064,7 +38875,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39104,7 +38915,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39173,7 +38984,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39214,7 +39025,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39285,7 +39096,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39404,7 +39215,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39444,7 +39255,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39513,7 +39324,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39554,7 +39365,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -40601,7 +40412,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42061,7 +41876,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42420,7 +42239,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42715,7 +42538,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -42833,7 +42656,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42873,7 +42696,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -42966,7 +42789,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -43083,7 +42906,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43123,7 +42946,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -43459,7 +43282,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44134,7 +43961,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44571,7 +44402,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44933,7 +44768,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -45293,7 +45132,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -45912,7 +45755,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46029,7 +45872,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46069,7 +45912,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46139,7 +45982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46256,7 +46099,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46296,7 +46139,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46366,7 +46209,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46483,7 +46326,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46523,7 +46366,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46593,7 +46436,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46720,7 +46563,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46761,7 +46604,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46832,7 +46675,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46948,7 +46791,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -46988,7 +46831,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47058,7 +46901,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47174,7 +47017,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47214,7 +47057,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47284,7 +47127,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47400,7 +47243,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47440,7 +47283,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47510,7 +47353,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47626,7 +47469,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47666,7 +47509,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47736,7 +47579,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47852,7 +47695,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47892,7 +47735,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47962,7 +47805,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48078,7 +47921,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48118,7 +47961,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48188,7 +48031,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48304,7 +48147,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48344,7 +48187,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48414,7 +48257,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48530,7 +48373,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48570,7 +48413,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -49261,7 +49104,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -50211,7 +50058,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50328,7 +50175,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50368,7 +50215,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50438,7 +50285,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50553,7 +50400,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50593,7 +50440,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50663,7 +50510,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50779,7 +50626,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50819,7 +50666,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -51149,7 +50996,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -51655,7 +51506,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -52013,7 +51868,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -52369,7 +52228,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -53194,7 +53057,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -53795,7 +53662,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -54154,7 +54025,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -54514,7 +54389,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -55656,7 +55535,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -55771,7 +55650,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55811,7 +55690,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55876,7 +55755,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55917,7 +55796,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55988,7 +55867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56107,7 +55986,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56147,7 +56026,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56216,7 +56095,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56257,7 +56136,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56347,7 +56226,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56484,7 +56363,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56524,7 +56403,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56594,7 +56473,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56728,7 +56607,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56768,7 +56647,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56838,7 +56717,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56958,7 +56837,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -56998,7 +56877,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57068,7 +56947,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57191,7 +57070,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57231,7 +57110,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57301,7 +57180,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57422,7 +57301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57462,7 +57341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57532,7 +57411,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57651,7 +57530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57691,7 +57570,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57761,7 +57640,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57880,7 +57759,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57920,7 +57799,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57990,7 +57869,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58107,7 +57986,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58148,7 +58027,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58294,7 +58173,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58445,7 +58324,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58485,7 +58364,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58555,7 +58434,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58710,7 +58589,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58750,7 +58629,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58819,7 +58698,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58860,7 +58739,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58931,7 +58810,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -59050,7 +58929,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59090,7 +58969,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -59159,7 +59038,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59200,7 +59079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -60247,7 +60126,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -62046,7 +61929,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -62171,7 +62054,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62212,7 +62095,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -62688,7 +62571,11 @@ get names(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -63371,7 +63258,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -63732,7 +63623,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64095,7 +63990,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64453,7 +64352,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64811,7 +64714,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65169,7 +65076,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65527,7 +65438,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65883,7 +65798,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66205,7 +66124,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66564,7 +66487,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66861,7 +66788,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -66979,7 +66906,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67019,7 +66946,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67112,7 +67039,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -67229,7 +67156,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67269,7 +67196,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67605,7 +67532,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -68005,7 +67936,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68132,7 +68063,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68173,7 +68104,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -68431,7 +68362,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -68775,7 +68710,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68902,7 +68837,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68943,7 +68878,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -69250,7 +69185,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -70492,7 +70431,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70607,7 +70546,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70647,7 +70586,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70712,7 +70651,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70753,7 +70692,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70824,7 +70763,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70943,7 +70882,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70983,7 +70922,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71052,7 +70991,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71093,7 +71032,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71183,7 +71122,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71320,7 +71259,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71360,7 +71299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71430,7 +71369,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71564,7 +71503,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71604,7 +71543,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71674,7 +71613,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71794,7 +71733,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71834,7 +71773,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71904,7 +71843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72027,7 +71966,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72067,7 +72006,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72137,7 +72076,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72258,7 +72197,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72298,7 +72237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72368,7 +72307,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72487,7 +72426,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72527,7 +72466,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72597,7 +72536,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72716,7 +72655,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72756,7 +72695,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72826,7 +72765,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72943,7 +72882,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -72984,7 +72923,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73130,7 +73069,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73281,7 +73220,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73321,7 +73260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73391,7 +73330,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73546,7 +73485,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73586,7 +73525,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73655,7 +73594,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73696,7 +73635,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73767,7 +73706,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73886,7 +73825,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73926,7 +73865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73995,7 +73934,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74036,7 +73975,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -75083,7 +75022,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -76533,7 +76476,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -77675,7 +77622,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -77790,7 +77737,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77830,7 +77777,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -77895,7 +77842,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -77936,7 +77883,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78007,7 +77954,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78126,7 +78073,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78166,7 +78113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78235,7 +78182,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78276,7 +78223,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78366,7 +78313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78503,7 +78450,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78543,7 +78490,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78613,7 +78560,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78747,7 +78694,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78787,7 +78734,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78857,7 +78804,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78977,7 +78924,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79017,7 +78964,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79087,7 +79034,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79210,7 +79157,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79250,7 +79197,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79320,7 +79267,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79441,7 +79388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79481,7 +79428,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79551,7 +79498,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79670,7 +79617,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79710,7 +79657,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79780,7 +79727,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79899,7 +79846,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -79939,7 +79886,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80009,7 +79956,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80126,7 +80073,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80167,7 +80114,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80313,7 +80260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80464,7 +80411,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80504,7 +80451,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80574,7 +80521,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80729,7 +80676,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80769,7 +80716,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80838,7 +80785,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -80879,7 +80826,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80950,7 +80897,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -81069,7 +81016,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81109,7 +81056,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -81178,7 +81125,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81219,7 +81166,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -82266,7 +82213,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -84172,7 +84123,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -84650,7 +84605,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -84767,7 +84722,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84807,7 +84762,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85063,7 +85018,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -85566,7 +85525,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85685,7 +85644,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85726,7 +85685,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85797,7 +85756,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85916,7 +85875,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -85957,7 +85916,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86058,7 +86017,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86176,7 +86135,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86216,7 +86175,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86309,7 +86268,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86426,7 +86385,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86466,7 +86425,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86785,7 +86744,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -87481,7 +87444,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -87843,7 +87810,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -88261,7 +88232,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88380,7 +88351,7 @@ relationships?: (Object | URL)[];} let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88420,7 +88391,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88490,7 +88461,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88606,7 +88577,7 @@ relationships?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88646,7 +88617,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88712,7 +88683,7 @@ relationships?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88753,7 +88724,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88824,7 +88795,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88942,7 +88913,7 @@ relationships?: (Object | URL)[];} let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -88982,7 +88953,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89050,7 +89021,7 @@ relationships?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89091,7 +89062,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89418,7 +89389,11 @@ relationships?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -89938,7 +89913,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -91080,7 +91059,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91195,7 +91174,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91235,7 +91214,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91300,7 +91279,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91341,7 +91320,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91412,7 +91391,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91531,7 +91510,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91571,7 +91550,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91640,7 +91619,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91681,7 +91660,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91771,7 +91750,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91908,7 +91887,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -91948,7 +91927,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92018,7 +91997,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92152,7 +92131,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92192,7 +92171,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92262,7 +92241,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92382,7 +92361,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92422,7 +92401,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92492,7 +92471,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92615,7 +92594,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92655,7 +92634,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92725,7 +92704,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92846,7 +92825,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -92886,7 +92865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92956,7 +92935,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93075,7 +93054,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93115,7 +93094,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93185,7 +93164,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93304,7 +93283,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93344,7 +93323,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93414,7 +93393,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93531,7 +93510,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93572,7 +93551,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93718,7 +93697,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93869,7 +93848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -93909,7 +93888,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93979,7 +93958,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94134,7 +94113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94174,7 +94153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94243,7 +94222,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94284,7 +94263,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94355,7 +94334,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94474,7 +94453,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94514,7 +94493,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94583,7 +94562,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94624,7 +94603,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -95671,7 +95650,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -97337,7 +97320,11 @@ get contents(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -97795,7 +97782,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -98153,7 +98144,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -98727,7 +98722,11 @@ get formerTypes(): (\$EntityType)[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99186,7 +99185,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99549,7 +99552,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99910,7 +99917,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -100271,7 +100282,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -100628,7 +100643,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index de4abd5e0..fd5ed4f5f 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -6,6 +6,7 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from \\"@opentelemetry/api\\"; import { canParseDecimal, + compactJsonLdCache, decodeMultibase, type Decimal, type DocumentLoader, @@ -14,11 +15,13 @@ import { exportSpki, formatIri, getDocumentLoader, - haveSameIriOrigin, + getJsonLdContext, importMultibaseKey, importPem, isDecimal, + isTrustedIriOrigin, LanguageString, + normalizeJsonLdIris, parseDecimal, parseIri, parseJsonLdId, @@ -28,317 +31,9 @@ import { isTemporalDuration, isTemporalInstant, } from \\"@fedify/vocab-runtime/temporal\\"; - - -function hasTrustedIriOrigin( - options: { crossOrigin?: \\"ignore\\" | \\"throw\\" | \\"trust\\" }, - left: URL | null | undefined, - right: URL | null | undefined, -): boolean { - return options.crossOrigin === \\"trust\\" || left == null || - (right != null && haveSameIriOrigin(left, right)); -} - const PORTABLE_IRI_PATTERN = /^ap(?:\\\\+ef61)?:\\\\/\\\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set([\\"@id\\",\\"_misskey_quote\\",\\"actor\\",\\"alsoKnownAs\\",\\"announceAuthorization\\",\\"anyOf\\",\\"approvedBy\\",\\"assertionMethod\\",\\"attachment\\",\\"attributedTo\\",\\"audience\\",\\"automaticApproval\\",\\"bcc\\",\\"bto\\",\\"cc\\",\\"context\\",\\"controller\\",\\"current\\",\\"describes\\",\\"emojiReactions\\",\\"featured\\",\\"featuredTags\\",\\"first\\",\\"followers\\",\\"followersOf\\",\\"following\\",\\"followingOf\\",\\"generator\\",\\"href\\",\\"http://fedibird.com/ns#emojiReactions\\",\\"http://fedibird.com/ns#quoteUri\\",\\"http://joinmastodon.org/ns#featured\\",\\"http://joinmastodon.org/ns#featuredTags\\",\\"http://www.w3.org/ns/ldp#inbox\\",\\"https://gotosocial.org/ns#announceAuthorization\\",\\"https://gotosocial.org/ns#approvedBy\\",\\"https://gotosocial.org/ns#automaticApproval\\",\\"https://gotosocial.org/ns#interactingObject\\",\\"https://gotosocial.org/ns#interactionTarget\\",\\"https://gotosocial.org/ns#likeAuthorization\\",\\"https://gotosocial.org/ns#manualApproval\\",\\"https://gotosocial.org/ns#replyAuthorization\\",\\"https://misskey-hub.net/ns#_misskey_quote\\",\\"https://w3id.org/fep/044f#quote\\",\\"https://w3id.org/fep/044f#quoteAuthorization\\",\\"https://w3id.org/fep/5711#followersOf\\",\\"https://w3id.org/fep/5711#followingOf\\",\\"https://w3id.org/fep/5711#inboxOf\\",\\"https://w3id.org/fep/5711#likedOf\\",\\"https://w3id.org/fep/5711#likesOf\\",\\"https://w3id.org/fep/5711#outboxOf\\",\\"https://w3id.org/fep/5711#repliesOf\\",\\"https://w3id.org/fep/5711#sharesOf\\",\\"https://w3id.org/security#assertionMethod\\",\\"https://w3id.org/security#controller\\",\\"https://w3id.org/security#owner\\",\\"https://w3id.org/security#proof\\",\\"https://w3id.org/security#publicKey\\",\\"https://w3id.org/security#verificationMethod\\",\\"https://w3id.org/valueflows/ont/vf#resourceConformsTo\\",\\"https://w3id.org/valueflows/ont/vf#satisfies\\",\\"https://www.w3.org/ns/activitystreams#actor\\",\\"https://www.w3.org/ns/activitystreams#alsoKnownAs\\",\\"https://www.w3.org/ns/activitystreams#anyOf\\",\\"https://www.w3.org/ns/activitystreams#attachment\\",\\"https://www.w3.org/ns/activitystreams#attributedTo\\",\\"https://www.w3.org/ns/activitystreams#audience\\",\\"https://www.w3.org/ns/activitystreams#bcc\\",\\"https://www.w3.org/ns/activitystreams#bto\\",\\"https://www.w3.org/ns/activitystreams#cc\\",\\"https://www.w3.org/ns/activitystreams#context\\",\\"https://www.w3.org/ns/activitystreams#current\\",\\"https://www.w3.org/ns/activitystreams#describes\\",\\"https://www.w3.org/ns/activitystreams#first\\",\\"https://www.w3.org/ns/activitystreams#followers\\",\\"https://www.w3.org/ns/activitystreams#following\\",\\"https://www.w3.org/ns/activitystreams#generator\\",\\"https://www.w3.org/ns/activitystreams#href\\",\\"https://www.w3.org/ns/activitystreams#icon\\",\\"https://www.w3.org/ns/activitystreams#image\\",\\"https://www.w3.org/ns/activitystreams#inReplyTo\\",\\"https://www.w3.org/ns/activitystreams#instrument\\",\\"https://www.w3.org/ns/activitystreams#items\\",\\"https://www.w3.org/ns/activitystreams#last\\",\\"https://www.w3.org/ns/activitystreams#liked\\",\\"https://www.w3.org/ns/activitystreams#likes\\",\\"https://www.w3.org/ns/activitystreams#location\\",\\"https://www.w3.org/ns/activitystreams#movedTo\\",\\"https://www.w3.org/ns/activitystreams#next\\",\\"https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint\\",\\"https://www.w3.org/ns/activitystreams#oauthTokenEndpoint\\",\\"https://www.w3.org/ns/activitystreams#object\\",\\"https://www.w3.org/ns/activitystreams#oneOf\\",\\"https://www.w3.org/ns/activitystreams#origin\\",\\"https://www.w3.org/ns/activitystreams#outbox\\",\\"https://www.w3.org/ns/activitystreams#partOf\\",\\"https://www.w3.org/ns/activitystreams#prev\\",\\"https://www.w3.org/ns/activitystreams#preview\\",\\"https://www.w3.org/ns/activitystreams#provideClientKey\\",\\"https://www.w3.org/ns/activitystreams#proxyUrl\\",\\"https://www.w3.org/ns/activitystreams#quoteUrl\\",\\"https://www.w3.org/ns/activitystreams#relationship\\",\\"https://www.w3.org/ns/activitystreams#replies\\",\\"https://www.w3.org/ns/activitystreams#result\\",\\"https://www.w3.org/ns/activitystreams#sharedInbox\\",\\"https://www.w3.org/ns/activitystreams#shares\\",\\"https://www.w3.org/ns/activitystreams#signClientKey\\",\\"https://www.w3.org/ns/activitystreams#streams\\",\\"https://www.w3.org/ns/activitystreams#subject\\",\\"https://www.w3.org/ns/activitystreams#tag\\",\\"https://www.w3.org/ns/activitystreams#target\\",\\"https://www.w3.org/ns/activitystreams#to\\",\\"https://www.w3.org/ns/activitystreams#units\\",\\"https://www.w3.org/ns/activitystreams#url\\",\\"https://www.w3.org/ns/did#service\\",\\"https://www.w3.org/ns/did#serviceEndpoint\\",\\"icon\\",\\"id\\",\\"image\\",\\"inReplyTo\\",\\"inbox\\",\\"inboxOf\\",\\"instrument\\",\\"interactingObject\\",\\"interactionTarget\\",\\"items\\",\\"last\\",\\"likeAuthorization\\",\\"liked\\",\\"likedOf\\",\\"likes\\",\\"likesOf\\",\\"location\\",\\"manualApproval\\",\\"movedTo\\",\\"next\\",\\"oauthAuthorizationEndpoint\\",\\"oauthTokenEndpoint\\",\\"object\\",\\"oneOf\\",\\"orderedItems\\",\\"origin\\",\\"outbox\\",\\"outboxOf\\",\\"owner\\",\\"partOf\\",\\"prev\\",\\"preview\\",\\"proof\\",\\"provideClientKey\\",\\"proxyUrl\\",\\"publicKey\\",\\"quote\\",\\"quoteAuthorization\\",\\"quoteUri\\",\\"quoteUrl\\",\\"relationship\\",\\"replies\\",\\"repliesOf\\",\\"replyAuthorization\\",\\"resourceConformsTo\\",\\"result\\",\\"satisfies\\",\\"service\\",\\"sharedInbox\\",\\"shares\\",\\"sharesOf\\",\\"signClientKey\\",\\"streams\\",\\"subject\\",\\"tag\\",\\"target\\",\\"to\\",\\"units\\",\\"url\\"]); -function isPortableIriValuePosition( - key: string, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): boolean { - return portableIriKeys.has(key) || - ((key === \\"@value\\" || key === \\"@list\\" || key === \\"@set\\") && - parentKey != null && portableIriKeys.has(parentKey)); -} - -function formatPortableIriForCache(value: string): string { - try { - return formatIri(value); - } catch { - return value; - } -} - -function normalizePortableIris( - value: unknown, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): unknown { - if (depth > 32 || key === \\"@context\\") return value; - if (typeof value === \\"string\\") { - if ( - key != null && - isPortableIriValuePosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ) { - return formatPortableIriForCache(value); - } - return value; - } - if (Array.isArray(value)) { - let clone: unknown[] | undefined; - for (let i = 0; i < value.length; i++) { - const result = normalizePortableIris( - value[i], - key, - depth + 1, - parentKey, - portableIriKeys, - ); - if (result !== value[i]) { - clone ??= value.slice(0, i); - clone.push(result); - } else if (clone != null) { - clone.push(value[i]); - } - } - return clone ?? value; - } - if (value == null || typeof value !== \\"object\\") { - return value; - } - const object = value as Record; - let clone: Record | undefined; - for (const entryKey of globalThis.Object.keys(object)) { - const result = normalizePortableIris( - object[entryKey], - entryKey, - depth + 1, - key, - portableIriKeys, - ); - if (result !== object[entryKey]) { - clone ??= { ...object }; - clone[entryKey] = result; - } - } - return clone ?? object; -} - -function getJsonLdContext(value: unknown, depth = 0): unknown { - if (depth > 32) return undefined; - if (Array.isArray(value)) { - for (const item of value) { - const context = getJsonLdContext(item, depth + 1); - if (context !== undefined) return context; - } - return undefined; - } - if ( - value == null || typeof value !== \\"object\\" || - !(\\"@context\\" in value) - ) { - return undefined; - } - return (value as Record)[\\"@context\\"]; -} - -async function compactJsonLdCache( - normalized: unknown, - original: unknown, - documentLoader?: DocumentLoader, - depth = 0, -): Promise { - if (depth > 32) return normalized; - if (Array.isArray(original)) { - const normalizedArray = Array.isArray(normalized) - ? normalized - : normalized != null && typeof normalized === \\"object\\" && - \\"@graph\\" in normalized && - Array.isArray((normalized as Record)[\\"@graph\\"]) - ? (normalized as Record)[\\"@graph\\"] as unknown[] - : undefined; - if (normalizedArray == null) return normalized; - let clone: unknown[] | undefined; - for (let i = 0; i < normalizedArray.length; i++) { - const item = await compactJsonLdCache( - normalizedArray[i], - original[i], - documentLoader, - depth + 1, - ); - if (item !== normalizedArray[i]) { - clone ??= normalizedArray.slice(0, i); - clone.push(item); - } else if (clone != null) { - clone.push(normalizedArray[i]); - } - } - return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); - } - const context = getJsonLdContext(original); - if (context == null) return normalized; - return preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader, - }, - ), - original, - context, - documentLoader, - ), - original, - ); -} - -function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { - const terms = new Set(); - const nodes = Array.isArray(value) ? value : [value]; - for (const node of nodes) { - if (node == null || typeof node !== \\"object\\" || Array.isArray(node)) { - continue; - } - for (const key of globalThis.Object.keys(node)) { - if (key.startsWith(\\"@\\")) continue; - terms.add(key); - } - } - return terms; -} - -async function mergeUnmappedJsonLdTerms( - compacted: unknown, - original: unknown, - context: unknown, - documentLoader?: DocumentLoader, -): Promise { - if ( - original == null || typeof original !== \\"object\\" || - Array.isArray(original) || - compacted == null || typeof compacted !== \\"object\\" || - Array.isArray(compacted) - ) { - return compacted; - } - const result = { ...compacted as Record }; - const unmappedKeys = globalThis.Object.keys(original).filter((key) => - key !== \\"@context\\" && - !globalThis.Object.prototype.hasOwnProperty.call(result, key) - ); - if (unmappedKeys.length < 1) return result; - const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { - documentLoader, - })); - const dummyPrefix = \\"urn:fedify:dummy:\\"; - const dummy: Record = { \\"@context\\": context }; - for (let i = 0; i < unmappedKeys.length; i++) { - dummy[unmappedKeys[i]] = \`\${dummyPrefix}\${i}\`; - } - const expanded = await jsonld.expand(dummy, { documentLoader }); - const representedKeys = new Set(); - const nodes = Array.isArray(expanded) ? expanded : [expanded]; - for (const node of nodes) { - if (node == null || typeof node !== \\"object\\" || Array.isArray(node)) { - continue; - } - for (const [term, termValue] of globalThis.Object.entries(node)) { - if (!compactedTerms.has(term)) continue; - const value = JSON.stringify(termValue); - for (let i = 0; i < unmappedKeys.length; i++) { - if (value.includes(\`\${dummyPrefix}\${i}\`)) { - representedKeys.add(unmappedKeys[i]); - } - } - } - } - for (const key of unmappedKeys) { - if (!representedKeys.has(key)) { - const value = (original as Record)[key]; - result[key] = structuredClone(value); - } - } - return result; -} - -function preserveJsonLdArrayShape( - compacted: unknown, - original: unknown, - depth = 0, -): unknown { - if (depth > 32) return compacted; - if ( - original == null || typeof original !== \\"object\\" || - compacted == null || typeof compacted !== \\"object\\" - ) { - return compacted; - } - if (Array.isArray(original)) { - const compactedArray = Array.isArray(compacted) - ? compacted - : \\"@graph\\" in compacted && - Array.isArray((compacted as Record)[\\"@graph\\"]) - ? (compacted as Record)[\\"@graph\\"] as unknown[] - : undefined; - if (compactedArray == null) return compacted; - let clone: unknown[] | undefined; - for (let i = 0; i < compactedArray.length; i++) { - const value = preserveJsonLdArrayShape( - compactedArray[i], - original[i], - depth + 1, - ); - const originalContext = original[i] != null && - typeof original[i] === \\"object\\" && !Array.isArray(original[i]) && - \\"@context\\" in original[i] - ? (original[i] as Record)[\\"@context\\"] - : undefined; - const shaped = originalContext !== undefined && - value != null && typeof value === \\"object\\" && - !Array.isArray(value) && !(\\"@context\\" in value) - ? { \\"@context\\": originalContext, ...value as Record } - : value; - if (shaped !== compactedArray[i]) { - clone ??= compactedArray.slice(0, i); - clone.push(shaped); - } else if (clone != null) { - clone.push(compactedArray[i]); - } - } - return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); - } - if (Array.isArray(compacted)) return compacted; - let clone: Record | undefined; - const compactedObject = compacted as Record; - const originalObject = original as Record; - for (const key of globalThis.Object.keys(compactedObject)) { - if (key === \\"@context\\") continue; - const value = preserveJsonLdArrayShape( - compactedObject[key], - originalObject[key], - depth + 1, - ); - const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) - ? [value] - : value; - if (shaped !== compactedObject[key]) { - clone ??= { ...compactedObject }; - clone[key] = shaped; - } - } - if (depth > 0) { - for (const key of globalThis.Object.keys(originalObject)) { - if ( - key.startsWith(\\"@\\") || - globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) - ) { - continue; - } - clone ??= { ...compactedObject }; - clone[key] = structuredClone(originalObject[key]); - } - } - return clone ?? compactedObject; -} - import * as _ppM0 from \\"./preprocessors.ts\\"; /** Describes an object of any kind. The Object type serves as the base type for @@ -2493,7 +2188,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2630,7 +2325,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2671,7 +2366,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -2742,7 +2437,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -2896,7 +2591,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2936,7 +2631,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3004,7 +2699,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3045,7 +2740,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3116,7 +2811,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3233,7 +2928,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3273,7 +2968,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3340,7 +3035,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3381,7 +3076,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3481,7 +3176,7 @@ get contents(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3613,7 +3308,7 @@ get contents(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3654,7 +3349,7 @@ get contents(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -3767,7 +3462,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -3893,7 +3588,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3934,7 +3629,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4005,7 +3700,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4144,7 +3839,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4184,7 +3879,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4252,7 +3947,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4293,7 +3988,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4364,7 +4059,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4503,7 +4198,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4543,7 +4238,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4611,7 +4306,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4652,7 +4347,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4723,7 +4418,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -4849,7 +4544,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4889,7 +4584,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -4956,7 +4651,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4997,7 +4692,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5068,7 +4763,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5194,7 +4889,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5234,7 +4929,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5301,7 +4996,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5342,7 +5037,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5413,7 +5108,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5538,7 +5233,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5578,7 +5273,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5644,7 +5339,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5685,7 +5380,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5769,7 +5464,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -5886,7 +5581,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5926,7 +5621,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -5996,7 +5691,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6119,7 +5814,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6159,7 +5854,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6229,7 +5924,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6352,7 +6047,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6392,7 +6087,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6462,7 +6157,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6579,7 +6274,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6619,7 +6314,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -6729,7 +6424,7 @@ get summaries(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -6858,7 +6553,7 @@ get summaries(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6899,7 +6594,7 @@ get summaries(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7004,7 +6699,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7121,7 +6816,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7161,7 +6856,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7228,7 +6923,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7269,7 +6964,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7340,7 +7035,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7457,7 +7152,7 @@ get urls(): ((URL | Link))[] { let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7497,7 +7192,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7564,7 +7259,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7605,7 +7300,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7676,7 +7371,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -7793,7 +7488,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7833,7 +7528,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -7900,7 +7595,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7941,7 +7636,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8012,7 +7707,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8129,7 +7824,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8169,7 +7864,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8236,7 +7931,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8277,7 +7972,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8412,7 +8107,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8528,7 +8223,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8568,7 +8263,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8634,7 +8329,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8675,7 +8370,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -8785,7 +8480,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -8902,7 +8597,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8942,7 +8637,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -9012,7 +8707,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9129,7 +8824,7 @@ get urls(): ((URL | Link))[] { let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9169,7 +8864,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -9239,7 +8934,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -9356,7 +9051,7 @@ get urls(): ((URL | Link))[] { let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9396,7 +9091,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -11214,7 +10909,11 @@ get urls(): ((URL | Link))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -13561,7 +13260,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -13861,7 +13564,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -13979,7 +13682,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -14019,7 +13722,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14112,7 +13815,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -14229,7 +13932,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14269,7 +13972,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -14605,7 +14308,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -15482,7 +15189,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15636,7 +15343,7 @@ instruments?: (Object | URL)[];} let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15676,7 +15383,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15744,7 +15451,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15785,7 +15492,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -15856,7 +15563,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -15974,7 +15681,7 @@ instruments?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -16014,7 +15721,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16082,7 +15789,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16123,7 +15830,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16194,7 +15901,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16315,7 +16022,7 @@ instruments?: (Object | URL)[];} let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16355,7 +16062,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16426,7 +16133,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16467,7 +16174,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16538,7 +16245,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16656,7 +16363,7 @@ instruments?: (Object | URL)[];} let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16696,7 +16403,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16764,7 +16471,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16805,7 +16512,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -16876,7 +16583,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -16995,7 +16702,7 @@ instruments?: (Object | URL)[];} let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -17035,7 +16742,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17104,7 +16811,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17145,7 +16852,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17216,7 +16923,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -17333,7 +17040,7 @@ instruments?: (Object | URL)[];} let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17373,7 +17080,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17440,7 +17147,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17481,7 +17188,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -17912,7 +17619,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -18625,7 +18336,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -19159,7 +18874,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -19778,7 +19497,11 @@ unit?: string | null;numericalValue?: Decimal | null;} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -20143,7 +19866,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20260,7 +19983,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20300,7 +20023,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20370,7 +20093,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -20486,7 +20209,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20526,7 +20249,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -20817,7 +20540,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -21284,7 +21011,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -21906,7 +21637,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -22687,7 +22422,11 @@ get manualApprovals(): (URL)[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -23063,7 +22802,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23180,7 +22919,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23220,7 +22959,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23290,7 +23029,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -23406,7 +23145,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23446,7 +23185,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -23737,7 +23476,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -24203,7 +23946,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -24479,7 +24226,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24596,7 +24343,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24636,7 +24383,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -24706,7 +24453,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -24822,7 +24569,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24862,7 +24609,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -25153,7 +24900,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -25619,7 +25370,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -25895,7 +25650,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26011,7 +25766,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26051,7 +25806,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26121,7 +25876,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -26237,7 +25992,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26277,7 +26032,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -26568,7 +26323,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27034,7 +26793,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27514,7 +27277,11 @@ get endpoints(): (URL)[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27874,7 +27641,11 @@ endpoints?: (URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -28277,7 +28048,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -28396,7 +28167,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28411,7 +28182,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -28723,7 +28494,11 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -29249,7 +29024,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -29400,7 +29175,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29440,7 +29215,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -29729,7 +29504,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -30161,7 +29940,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -30312,7 +30091,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30352,7 +30131,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -30648,7 +30427,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -31297,7 +31080,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -31907,7 +31694,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -32743,7 +32534,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -33626,7 +33421,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34147,7 +33946,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34507,7 +34310,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34866,7 +34673,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -36008,7 +35819,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36123,7 +35934,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36163,7 +35974,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36228,7 +36039,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36269,7 +36080,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36340,7 +36151,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36459,7 +36270,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36499,7 +36310,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36568,7 +36379,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36609,7 +36420,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36699,7 +36510,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -36836,7 +36647,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36876,7 +36687,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -36946,7 +36757,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37080,7 +36891,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37120,7 +36931,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37190,7 +37001,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37310,7 +37121,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37350,7 +37161,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37420,7 +37231,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37543,7 +37354,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37583,7 +37394,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37653,7 +37464,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -37774,7 +37585,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37814,7 +37625,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -37884,7 +37695,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38003,7 +37814,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38043,7 +37854,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38113,7 +37924,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38232,7 +38043,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38272,7 +38083,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38342,7 +38153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38459,7 +38270,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38500,7 +38311,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38646,7 +38457,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -38797,7 +38608,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38837,7 +38648,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -38907,7 +38718,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39062,7 +38873,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39102,7 +38913,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39171,7 +38982,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39212,7 +39023,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39283,7 +39094,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -39402,7 +39213,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39442,7 +39253,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -39511,7 +39322,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39552,7 +39363,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -40599,7 +40410,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42059,7 +41874,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42418,7 +42237,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42713,7 +42536,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -42831,7 +42654,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42871,7 +42694,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -42964,7 +42787,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -43081,7 +42904,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43121,7 +42944,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -43457,7 +43280,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44132,7 +43959,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44569,7 +44400,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44931,7 +44766,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -45291,7 +45130,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -45910,7 +45753,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46027,7 +45870,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46067,7 +45910,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46137,7 +45980,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46254,7 +46097,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46294,7 +46137,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46364,7 +46207,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46481,7 +46324,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46521,7 +46364,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46591,7 +46434,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46718,7 +46561,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46759,7 +46602,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -46830,7 +46673,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -46946,7 +46789,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -46986,7 +46829,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47056,7 +46899,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47172,7 +47015,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47212,7 +47055,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47282,7 +47125,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47398,7 +47241,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47438,7 +47281,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47508,7 +47351,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47624,7 +47467,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47664,7 +47507,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47734,7 +47577,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -47850,7 +47693,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47890,7 +47733,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -47960,7 +47803,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48076,7 +47919,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48116,7 +47959,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48186,7 +48029,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48302,7 +48145,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48342,7 +48185,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -48412,7 +48255,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -48528,7 +48371,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48568,7 +48411,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -49259,7 +49102,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -50209,7 +50056,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50326,7 +50173,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50366,7 +50213,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50436,7 +50283,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50551,7 +50398,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50591,7 +50438,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -50661,7 +50508,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -50777,7 +50624,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50817,7 +50664,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -51147,7 +50994,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -51653,7 +51504,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -52011,7 +51866,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -52367,7 +52226,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -53192,7 +53055,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -53793,7 +53660,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -54152,7 +54023,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -54512,7 +54387,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -55654,7 +55533,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -55769,7 +55648,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55809,7 +55688,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55874,7 +55753,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55915,7 +55794,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -55986,7 +55865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56105,7 +55984,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56145,7 +56024,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56214,7 +56093,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56255,7 +56134,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56345,7 +56224,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56482,7 +56361,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56522,7 +56401,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56592,7 +56471,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56726,7 +56605,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56766,7 +56645,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -56836,7 +56715,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -56956,7 +56835,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -56996,7 +56875,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57066,7 +56945,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57189,7 +57068,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57229,7 +57108,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57299,7 +57178,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57420,7 +57299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57460,7 +57339,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57530,7 +57409,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57649,7 +57528,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57689,7 +57568,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57759,7 +57638,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -57878,7 +57757,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57918,7 +57797,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -57988,7 +57867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58105,7 +57984,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58146,7 +58025,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58292,7 +58171,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58443,7 +58322,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58483,7 +58362,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58553,7 +58432,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -58708,7 +58587,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58748,7 +58627,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58817,7 +58696,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58858,7 +58737,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -58929,7 +58808,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -59048,7 +58927,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59088,7 +58967,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -59157,7 +59036,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59198,7 +59077,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -60245,7 +60124,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -62044,7 +61927,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -62169,7 +62052,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62210,7 +62093,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -62686,7 +62569,11 @@ get names(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -63369,7 +63256,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -63730,7 +63621,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64093,7 +63988,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64451,7 +64350,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64809,7 +64712,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65167,7 +65074,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65525,7 +65436,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65881,7 +65796,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66203,7 +66122,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66562,7 +66485,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66859,7 +66786,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -66977,7 +66904,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67017,7 +66944,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67110,7 +67037,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -67227,7 +67154,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67267,7 +67194,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -67603,7 +67530,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -68003,7 +67934,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68130,7 +68061,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68171,7 +68102,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -68429,7 +68360,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -68773,7 +68708,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -68900,7 +68835,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68941,7 +68876,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -69248,7 +69183,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -70490,7 +70429,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70605,7 +70544,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70645,7 +70584,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70710,7 +70649,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70751,7 +70690,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -70822,7 +70761,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -70941,7 +70880,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70981,7 +70920,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71050,7 +70989,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71091,7 +71030,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71181,7 +71120,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71318,7 +71257,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71358,7 +71297,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71428,7 +71367,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71562,7 +71501,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71602,7 +71541,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71672,7 +71611,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -71792,7 +71731,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71832,7 +71771,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -71902,7 +71841,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72025,7 +71964,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72065,7 +72004,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72135,7 +72074,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72256,7 +72195,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72296,7 +72235,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72366,7 +72305,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72485,7 +72424,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72525,7 +72464,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72595,7 +72534,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72714,7 +72653,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72754,7 +72693,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -72824,7 +72763,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -72941,7 +72880,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -72982,7 +72921,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73128,7 +73067,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73279,7 +73218,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73319,7 +73258,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73389,7 +73328,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73544,7 +73483,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73584,7 +73523,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73653,7 +73592,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73694,7 +73633,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73765,7 +73704,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -73884,7 +73823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73924,7 +73863,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -73993,7 +73932,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74034,7 +73973,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -75081,7 +75020,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -76531,7 +76474,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -77673,7 +77620,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -77788,7 +77735,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77828,7 +77775,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -77893,7 +77840,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -77934,7 +77881,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78005,7 +77952,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78124,7 +78071,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78164,7 +78111,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78233,7 +78180,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78274,7 +78221,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78364,7 +78311,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78501,7 +78448,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78541,7 +78488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78611,7 +78558,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78745,7 +78692,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78785,7 +78732,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -78855,7 +78802,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -78975,7 +78922,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79015,7 +78962,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79085,7 +79032,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79208,7 +79155,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79248,7 +79195,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79318,7 +79265,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79439,7 +79386,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79479,7 +79426,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79549,7 +79496,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79668,7 +79615,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79708,7 +79655,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -79778,7 +79725,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -79897,7 +79844,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -79937,7 +79884,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80007,7 +79954,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80124,7 +80071,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80165,7 +80112,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80311,7 +80258,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80462,7 +80409,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80502,7 +80449,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80572,7 +80519,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -80727,7 +80674,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80767,7 +80714,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80836,7 +80783,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -80877,7 +80824,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -80948,7 +80895,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -81067,7 +81014,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81107,7 +81054,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -81176,7 +81123,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81217,7 +81164,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -82264,7 +82211,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -84170,7 +84121,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -84648,7 +84603,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -84765,7 +84720,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84805,7 +84760,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85061,7 +85016,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -85564,7 +85523,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85683,7 +85642,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85724,7 +85683,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -85795,7 +85754,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -85914,7 +85873,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -85955,7 +85914,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86056,7 +86015,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86174,7 +86133,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86214,7 +86173,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86307,7 +86266,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -86424,7 +86383,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86464,7 +86423,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -86783,7 +86742,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -87479,7 +87442,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -87841,7 +87808,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -88259,7 +88230,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88378,7 +88349,7 @@ relationships?: (Object | URL)[];} let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88418,7 +88389,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88488,7 +88459,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88604,7 +88575,7 @@ relationships?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88644,7 +88615,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88710,7 +88681,7 @@ relationships?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88751,7 +88722,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -88822,7 +88793,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -88940,7 +88911,7 @@ relationships?: (Object | URL)[];} let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -88980,7 +88951,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89048,7 +89019,7 @@ relationships?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89089,7 +89060,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -89416,7 +89387,11 @@ relationships?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -89936,7 +89911,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -91078,7 +91057,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91193,7 +91172,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91233,7 +91212,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91298,7 +91277,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91339,7 +91318,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91410,7 +91389,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91529,7 +91508,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91569,7 +91548,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91638,7 +91617,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91679,7 +91658,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -91769,7 +91748,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -91906,7 +91885,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -91946,7 +91925,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92016,7 +91995,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92150,7 +92129,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92190,7 +92169,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92260,7 +92239,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92380,7 +92359,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92420,7 +92399,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92490,7 +92469,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92613,7 +92592,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92653,7 +92632,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92723,7 +92702,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -92844,7 +92823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -92884,7 +92863,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -92954,7 +92933,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93073,7 +93052,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93113,7 +93092,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93183,7 +93162,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93302,7 +93281,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93342,7 +93321,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93412,7 +93391,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93529,7 +93508,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93570,7 +93549,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93716,7 +93695,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -93867,7 +93846,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -93907,7 +93886,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -93977,7 +93956,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94132,7 +94111,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94172,7 +94151,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94241,7 +94220,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94282,7 +94261,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94353,7 +94332,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The object's @id (\\" + obj.id.href + \\") has a different origin \\" + @@ -94472,7 +94451,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94512,7 +94491,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -94581,7 +94560,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94622,7 +94601,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === \\"throw\\") { throw new Error( @@ -95669,7 +95648,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -97335,7 +97318,11 @@ get contents(): ((string | LanguageString))[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -97793,7 +97780,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -98151,7 +98142,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -98725,7 +98720,11 @@ get formerTypes(): ($EntityType)[] { } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99184,7 +99183,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99547,7 +99550,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99908,7 +99915,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -100269,7 +100280,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -100626,7 +100641,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !(\\"_fromSubclass\\" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 635c62dc6..9a77364e1 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -8,6 +8,7 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from "@opentelemetry/api"; import { canParseDecimal, + compactJsonLdCache, decodeMultibase, type Decimal, type DocumentLoader, @@ -16,11 +17,13 @@ import { exportSpki, formatIri, getDocumentLoader, - haveSameIriOrigin, + getJsonLdContext, importMultibaseKey, importPem, isDecimal, + isTrustedIriOrigin, LanguageString, + normalizeJsonLdIris, parseDecimal, parseIri, parseJsonLdId, @@ -30,317 +33,9 @@ import { isTemporalDuration, isTemporalInstant, } from "@fedify/vocab-runtime/temporal"; - - -function hasTrustedIriOrigin( - options: { crossOrigin?: "ignore" | "throw" | "trust" }, - left: URL | null | undefined, - right: URL | null | undefined, -): boolean { - return options.crossOrigin === "trust" || left == null || - (right != null && haveSameIriOrigin(left, right)); -} - const PORTABLE_IRI_PATTERN = /^ap(?:\\+ef61)?:\\/\\//i; const PORTABLE_IRI_KEYS: ReadonlySet = new Set(["@id","_misskey_quote","actor","alsoKnownAs","announceAuthorization","anyOf","approvedBy","assertionMethod","attachment","attributedTo","audience","automaticApproval","bcc","bto","cc","context","controller","current","describes","emojiReactions","featured","featuredTags","first","followers","followersOf","following","followingOf","generator","href","http://fedibird.com/ns#emojiReactions","http://fedibird.com/ns#quoteUri","http://joinmastodon.org/ns#featured","http://joinmastodon.org/ns#featuredTags","http://www.w3.org/ns/ldp#inbox","https://gotosocial.org/ns#announceAuthorization","https://gotosocial.org/ns#approvedBy","https://gotosocial.org/ns#automaticApproval","https://gotosocial.org/ns#interactingObject","https://gotosocial.org/ns#interactionTarget","https://gotosocial.org/ns#likeAuthorization","https://gotosocial.org/ns#manualApproval","https://gotosocial.org/ns#replyAuthorization","https://misskey-hub.net/ns#_misskey_quote","https://w3id.org/fep/044f#quote","https://w3id.org/fep/044f#quoteAuthorization","https://w3id.org/fep/5711#followersOf","https://w3id.org/fep/5711#followingOf","https://w3id.org/fep/5711#inboxOf","https://w3id.org/fep/5711#likedOf","https://w3id.org/fep/5711#likesOf","https://w3id.org/fep/5711#outboxOf","https://w3id.org/fep/5711#repliesOf","https://w3id.org/fep/5711#sharesOf","https://w3id.org/security#assertionMethod","https://w3id.org/security#controller","https://w3id.org/security#owner","https://w3id.org/security#proof","https://w3id.org/security#publicKey","https://w3id.org/security#verificationMethod","https://w3id.org/valueflows/ont/vf#resourceConformsTo","https://w3id.org/valueflows/ont/vf#satisfies","https://www.w3.org/ns/activitystreams#actor","https://www.w3.org/ns/activitystreams#alsoKnownAs","https://www.w3.org/ns/activitystreams#anyOf","https://www.w3.org/ns/activitystreams#attachment","https://www.w3.org/ns/activitystreams#attributedTo","https://www.w3.org/ns/activitystreams#audience","https://www.w3.org/ns/activitystreams#bcc","https://www.w3.org/ns/activitystreams#bto","https://www.w3.org/ns/activitystreams#cc","https://www.w3.org/ns/activitystreams#context","https://www.w3.org/ns/activitystreams#current","https://www.w3.org/ns/activitystreams#describes","https://www.w3.org/ns/activitystreams#first","https://www.w3.org/ns/activitystreams#followers","https://www.w3.org/ns/activitystreams#following","https://www.w3.org/ns/activitystreams#generator","https://www.w3.org/ns/activitystreams#href","https://www.w3.org/ns/activitystreams#icon","https://www.w3.org/ns/activitystreams#image","https://www.w3.org/ns/activitystreams#inReplyTo","https://www.w3.org/ns/activitystreams#instrument","https://www.w3.org/ns/activitystreams#items","https://www.w3.org/ns/activitystreams#last","https://www.w3.org/ns/activitystreams#liked","https://www.w3.org/ns/activitystreams#likes","https://www.w3.org/ns/activitystreams#location","https://www.w3.org/ns/activitystreams#movedTo","https://www.w3.org/ns/activitystreams#next","https://www.w3.org/ns/activitystreams#oauthAuthorizationEndpoint","https://www.w3.org/ns/activitystreams#oauthTokenEndpoint","https://www.w3.org/ns/activitystreams#object","https://www.w3.org/ns/activitystreams#oneOf","https://www.w3.org/ns/activitystreams#origin","https://www.w3.org/ns/activitystreams#outbox","https://www.w3.org/ns/activitystreams#partOf","https://www.w3.org/ns/activitystreams#prev","https://www.w3.org/ns/activitystreams#preview","https://www.w3.org/ns/activitystreams#provideClientKey","https://www.w3.org/ns/activitystreams#proxyUrl","https://www.w3.org/ns/activitystreams#quoteUrl","https://www.w3.org/ns/activitystreams#relationship","https://www.w3.org/ns/activitystreams#replies","https://www.w3.org/ns/activitystreams#result","https://www.w3.org/ns/activitystreams#sharedInbox","https://www.w3.org/ns/activitystreams#shares","https://www.w3.org/ns/activitystreams#signClientKey","https://www.w3.org/ns/activitystreams#streams","https://www.w3.org/ns/activitystreams#subject","https://www.w3.org/ns/activitystreams#tag","https://www.w3.org/ns/activitystreams#target","https://www.w3.org/ns/activitystreams#to","https://www.w3.org/ns/activitystreams#units","https://www.w3.org/ns/activitystreams#url","https://www.w3.org/ns/did#service","https://www.w3.org/ns/did#serviceEndpoint","icon","id","image","inReplyTo","inbox","inboxOf","instrument","interactingObject","interactionTarget","items","last","likeAuthorization","liked","likedOf","likes","likesOf","location","manualApproval","movedTo","next","oauthAuthorizationEndpoint","oauthTokenEndpoint","object","oneOf","orderedItems","origin","outbox","outboxOf","owner","partOf","prev","preview","proof","provideClientKey","proxyUrl","publicKey","quote","quoteAuthorization","quoteUri","quoteUrl","relationship","replies","repliesOf","replyAuthorization","resourceConformsTo","result","satisfies","service","sharedInbox","shares","sharesOf","signClientKey","streams","subject","tag","target","to","units","url"]); -function isPortableIriValuePosition( - key: string, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): boolean { - return portableIriKeys.has(key) || - ((key === "@value" || key === "@list" || key === "@set") && - parentKey != null && portableIriKeys.has(parentKey)); -} - -function formatPortableIriForCache(value: string): string { - try { - return formatIri(value); - } catch { - return value; - } -} - -function normalizePortableIris( - value: unknown, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): unknown { - if (depth > 32 || key === "@context") return value; - if (typeof value === "string") { - if ( - key != null && - isPortableIriValuePosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ) { - return formatPortableIriForCache(value); - } - return value; - } - if (Array.isArray(value)) { - let clone: unknown[] | undefined; - for (let i = 0; i < value.length; i++) { - const result = normalizePortableIris( - value[i], - key, - depth + 1, - parentKey, - portableIriKeys, - ); - if (result !== value[i]) { - clone ??= value.slice(0, i); - clone.push(result); - } else if (clone != null) { - clone.push(value[i]); - } - } - return clone ?? value; - } - if (value == null || typeof value !== "object") { - return value; - } - const object = value as Record; - let clone: Record | undefined; - for (const entryKey of globalThis.Object.keys(object)) { - const result = normalizePortableIris( - object[entryKey], - entryKey, - depth + 1, - key, - portableIriKeys, - ); - if (result !== object[entryKey]) { - clone ??= { ...object }; - clone[entryKey] = result; - } - } - return clone ?? object; -} - -function getJsonLdContext(value: unknown, depth = 0): unknown { - if (depth > 32) return undefined; - if (Array.isArray(value)) { - for (const item of value) { - const context = getJsonLdContext(item, depth + 1); - if (context !== undefined) return context; - } - return undefined; - } - if ( - value == null || typeof value !== "object" || - !("@context" in value) - ) { - return undefined; - } - return (value as Record)["@context"]; -} - -async function compactJsonLdCache( - normalized: unknown, - original: unknown, - documentLoader?: DocumentLoader, - depth = 0, -): Promise { - if (depth > 32) return normalized; - if (Array.isArray(original)) { - const normalizedArray = Array.isArray(normalized) - ? normalized - : normalized != null && typeof normalized === "object" && - "@graph" in normalized && - Array.isArray((normalized as Record)["@graph"]) - ? (normalized as Record)["@graph"] as unknown[] - : undefined; - if (normalizedArray == null) return normalized; - let clone: unknown[] | undefined; - for (let i = 0; i < normalizedArray.length; i++) { - const item = await compactJsonLdCache( - normalizedArray[i], - original[i], - documentLoader, - depth + 1, - ); - if (item !== normalizedArray[i]) { - clone ??= normalizedArray.slice(0, i); - clone.push(item); - } else if (clone != null) { - clone.push(normalizedArray[i]); - } - } - return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); - } - const context = getJsonLdContext(original); - if (context == null) return normalized; - return preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader, - }, - ), - original, - context, - documentLoader, - ), - original, - ); -} - -function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { - const terms = new Set(); - const nodes = Array.isArray(value) ? value : [value]; - for (const node of nodes) { - if (node == null || typeof node !== "object" || Array.isArray(node)) { - continue; - } - for (const key of globalThis.Object.keys(node)) { - if (key.startsWith("@")) continue; - terms.add(key); - } - } - return terms; -} - -async function mergeUnmappedJsonLdTerms( - compacted: unknown, - original: unknown, - context: unknown, - documentLoader?: DocumentLoader, -): Promise { - if ( - original == null || typeof original !== "object" || - Array.isArray(original) || - compacted == null || typeof compacted !== "object" || - Array.isArray(compacted) - ) { - return compacted; - } - const result = { ...compacted as Record }; - const unmappedKeys = globalThis.Object.keys(original).filter((key) => - key !== "@context" && - !globalThis.Object.prototype.hasOwnProperty.call(result, key) - ); - if (unmappedKeys.length < 1) return result; - const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { - documentLoader, - })); - const dummyPrefix = "urn:fedify:dummy:"; - const dummy: Record = { "@context": context }; - for (let i = 0; i < unmappedKeys.length; i++) { - dummy[unmappedKeys[i]] = \`\${dummyPrefix}\${i}\`; - } - const expanded = await jsonld.expand(dummy, { documentLoader }); - const representedKeys = new Set(); - const nodes = Array.isArray(expanded) ? expanded : [expanded]; - for (const node of nodes) { - if (node == null || typeof node !== "object" || Array.isArray(node)) { - continue; - } - for (const [term, termValue] of globalThis.Object.entries(node)) { - if (!compactedTerms.has(term)) continue; - const value = JSON.stringify(termValue); - for (let i = 0; i < unmappedKeys.length; i++) { - if (value.includes(\`\${dummyPrefix}\${i}\`)) { - representedKeys.add(unmappedKeys[i]); - } - } - } - } - for (const key of unmappedKeys) { - if (!representedKeys.has(key)) { - const value = (original as Record)[key]; - result[key] = structuredClone(value); - } - } - return result; -} - -function preserveJsonLdArrayShape( - compacted: unknown, - original: unknown, - depth = 0, -): unknown { - if (depth > 32) return compacted; - if ( - original == null || typeof original !== "object" || - compacted == null || typeof compacted !== "object" - ) { - return compacted; - } - if (Array.isArray(original)) { - const compactedArray = Array.isArray(compacted) - ? compacted - : "@graph" in compacted && - Array.isArray((compacted as Record)["@graph"]) - ? (compacted as Record)["@graph"] as unknown[] - : undefined; - if (compactedArray == null) return compacted; - let clone: unknown[] | undefined; - for (let i = 0; i < compactedArray.length; i++) { - const value = preserveJsonLdArrayShape( - compactedArray[i], - original[i], - depth + 1, - ); - const originalContext = original[i] != null && - typeof original[i] === "object" && !Array.isArray(original[i]) && - "@context" in original[i] - ? (original[i] as Record)["@context"] - : undefined; - const shaped = originalContext !== undefined && - value != null && typeof value === "object" && - !Array.isArray(value) && !("@context" in value) - ? { "@context": originalContext, ...value as Record } - : value; - if (shaped !== compactedArray[i]) { - clone ??= compactedArray.slice(0, i); - clone.push(shaped); - } else if (clone != null) { - clone.push(compactedArray[i]); - } - } - return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); - } - if (Array.isArray(compacted)) return compacted; - let clone: Record | undefined; - const compactedObject = compacted as Record; - const originalObject = original as Record; - for (const key of globalThis.Object.keys(compactedObject)) { - if (key === "@context") continue; - const value = preserveJsonLdArrayShape( - compactedObject[key], - originalObject[key], - depth + 1, - ); - const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) - ? [value] - : value; - if (shaped !== compactedObject[key]) { - clone ??= { ...compactedObject }; - clone[key] = shaped; - } - } - if (depth > 0) { - for (const key of globalThis.Object.keys(originalObject)) { - if ( - key.startsWith("@") || - globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) - ) { - continue; - } - clone ??= { ...compactedObject }; - clone[key] = structuredClone(originalObject[key]); - } - } - return clone ?? compactedObject; -} - import * as _ppM0 from "./preprocessors.ts"; /** Describes an object of any kind. The Object type serves as the base type for @@ -2495,7 +2190,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -2632,7 +2327,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2673,7 +2368,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -2744,7 +2439,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -2898,7 +2593,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2938,7 +2633,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3006,7 +2701,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -3047,7 +2742,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3118,7 +2813,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3235,7 +2930,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3275,7 +2970,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3342,7 +3037,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3383,7 +3078,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3483,7 +3178,7 @@ get contents(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3615,7 +3310,7 @@ get contents(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3656,7 +3351,7 @@ get contents(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -3769,7 +3464,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -3895,7 +3590,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3936,7 +3631,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4007,7 +3702,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4146,7 +3841,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -4186,7 +3881,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4254,7 +3949,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4295,7 +3990,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4366,7 +4061,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4505,7 +4200,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4545,7 +4240,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4613,7 +4308,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4654,7 +4349,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4725,7 +4420,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -4851,7 +4546,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4891,7 +4586,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -4958,7 +4653,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4999,7 +4694,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5070,7 +4765,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5196,7 +4891,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5236,7 +4931,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5303,7 +4998,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5344,7 +5039,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5415,7 +5110,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5540,7 +5235,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5580,7 +5275,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5646,7 +5341,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5687,7 +5382,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5771,7 +5466,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -5888,7 +5583,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5928,7 +5623,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -5998,7 +5693,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6121,7 +5816,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6161,7 +5856,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6231,7 +5926,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6354,7 +6049,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6394,7 +6089,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6464,7 +6159,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6581,7 +6276,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6621,7 +6316,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -6731,7 +6426,7 @@ get summaries(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -6860,7 +6555,7 @@ get summaries(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6901,7 +6596,7 @@ get summaries(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7006,7 +6701,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7123,7 +6818,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -7163,7 +6858,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7230,7 +6925,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7271,7 +6966,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7342,7 +7037,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7459,7 +7154,7 @@ get urls(): ((URL | Link))[] { let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7499,7 +7194,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7566,7 +7261,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7607,7 +7302,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7678,7 +7373,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -7795,7 +7490,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7835,7 +7530,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -7902,7 +7597,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7943,7 +7638,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8014,7 +7709,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8131,7 +7826,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -8171,7 +7866,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8238,7 +7933,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8279,7 +7974,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8414,7 +8109,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8530,7 +8225,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8570,7 +8265,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8636,7 +8331,7 @@ get urls(): ((URL | Link))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8677,7 +8372,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -8787,7 +8482,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -8904,7 +8599,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8944,7 +8639,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -9014,7 +8709,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -9131,7 +8826,7 @@ get urls(): ((URL | Link))[] { let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9171,7 +8866,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -9241,7 +8936,7 @@ get urls(): ((URL | Link))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -9358,7 +9053,7 @@ get urls(): ((URL | Link))[] { let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -9398,7 +9093,7 @@ get urls(): ((URL | Link))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -11216,7 +10911,11 @@ get urls(): ((URL | Link))[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -13563,7 +13262,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -13863,7 +13566,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -13981,7 +13684,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -14021,7 +13724,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -14114,7 +13817,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -14231,7 +13934,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -14271,7 +13974,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -14607,7 +14310,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -15484,7 +15191,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -15638,7 +15345,7 @@ instruments?: (Object | URL)[];} let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15678,7 +15385,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -15746,7 +15453,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15787,7 +15494,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -15858,7 +15565,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -15976,7 +15683,7 @@ instruments?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -16016,7 +15723,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16084,7 +15791,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16125,7 +15832,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16196,7 +15903,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16317,7 +16024,7 @@ instruments?: (Object | URL)[];} let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16357,7 +16064,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16428,7 +16135,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16469,7 +16176,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16540,7 +16247,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16658,7 +16365,7 @@ instruments?: (Object | URL)[];} let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16698,7 +16405,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16766,7 +16473,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16807,7 +16514,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -16878,7 +16585,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -16997,7 +16704,7 @@ instruments?: (Object | URL)[];} let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -17037,7 +16744,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17106,7 +16813,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17147,7 +16854,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17218,7 +16925,7 @@ instruments?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -17335,7 +17042,7 @@ instruments?: (Object | URL)[];} let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17375,7 +17082,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17442,7 +17149,7 @@ instruments?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -17483,7 +17190,7 @@ instruments?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -17914,7 +17621,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -18627,7 +18338,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -19161,7 +18876,11 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -19780,7 +19499,11 @@ unit?: string | null;numericalValue?: Decimal | null;} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -20145,7 +19868,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -20262,7 +19985,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20302,7 +20025,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -20372,7 +20095,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -20488,7 +20211,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -20528,7 +20251,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -20819,7 +20542,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -21286,7 +21013,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -21908,7 +21639,11 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -22689,7 +22424,11 @@ get manualApprovals(): (URL)[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -23065,7 +22804,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -23182,7 +22921,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23222,7 +22961,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -23292,7 +23031,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -23408,7 +23147,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -23448,7 +23187,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -23739,7 +23478,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -24205,7 +23948,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -24481,7 +24228,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -24598,7 +24345,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24638,7 +24385,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -24708,7 +24455,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -24824,7 +24571,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24864,7 +24611,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -25155,7 +24902,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -25621,7 +25372,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -25897,7 +25652,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -26013,7 +25768,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26053,7 +25808,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -26123,7 +25878,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -26239,7 +25994,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -26279,7 +26034,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -26570,7 +26325,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27036,7 +26795,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27516,7 +27279,11 @@ get endpoints(): (URL)[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -27876,7 +27643,11 @@ endpoints?: (URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -28279,7 +28050,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -28398,7 +28169,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -28413,7 +28184,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -28725,7 +28496,11 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -29251,7 +29026,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -29402,7 +29177,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -29442,7 +29217,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -29731,7 +29506,11 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -30163,7 +29942,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -30314,7 +30093,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -30354,7 +30133,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -30650,7 +30429,11 @@ controller?: Application | Group | Organization | Person | Service | URL | null; } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -31299,7 +31082,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -31909,7 +31696,11 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -32745,7 +32536,11 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -33628,7 +33423,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34149,7 +33948,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34509,7 +34312,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -34868,7 +34675,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -36010,7 +35821,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36125,7 +35936,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36165,7 +35976,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36230,7 +36041,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36271,7 +36082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36342,7 +36153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36461,7 +36272,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36501,7 +36312,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36570,7 +36381,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36611,7 +36422,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36701,7 +36512,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -36838,7 +36649,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36878,7 +36689,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -36948,7 +36759,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37082,7 +36893,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37122,7 +36933,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37192,7 +37003,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37312,7 +37123,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37352,7 +37163,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37422,7 +37233,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37545,7 +37356,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37585,7 +37396,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37655,7 +37466,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -37776,7 +37587,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37816,7 +37627,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -37886,7 +37697,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38005,7 +37816,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38045,7 +37856,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38115,7 +37926,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38234,7 +38045,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38274,7 +38085,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38344,7 +38155,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38461,7 +38272,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38502,7 +38313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38648,7 +38459,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -38799,7 +38610,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38839,7 +38650,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -38909,7 +38720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -39064,7 +38875,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -39104,7 +38915,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39173,7 +38984,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39214,7 +39025,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39285,7 +39096,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -39404,7 +39215,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39444,7 +39255,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -39513,7 +39324,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -39554,7 +39365,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -40601,7 +40412,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42061,7 +41876,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42420,7 +42239,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -42715,7 +42538,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -42833,7 +42656,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42873,7 +42696,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -42966,7 +42789,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -43083,7 +42906,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -43123,7 +42946,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -43459,7 +43282,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44134,7 +43961,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44571,7 +44402,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -44933,7 +44768,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -45293,7 +45132,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -45912,7 +45755,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46029,7 +45872,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46069,7 +45912,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46139,7 +45982,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46256,7 +46099,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46296,7 +46139,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46366,7 +46209,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46483,7 +46326,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46523,7 +46366,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46593,7 +46436,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46720,7 +46563,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46761,7 +46604,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -46832,7 +46675,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -46948,7 +46791,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -46988,7 +46831,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47058,7 +46901,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47174,7 +47017,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47214,7 +47057,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47284,7 +47127,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47400,7 +47243,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47440,7 +47283,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47510,7 +47353,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47626,7 +47469,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47666,7 +47509,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47736,7 +47579,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -47852,7 +47695,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47892,7 +47735,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -47962,7 +47805,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48078,7 +47921,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48118,7 +47961,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -48188,7 +48031,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48304,7 +48147,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48344,7 +48187,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -48414,7 +48257,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -48530,7 +48373,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -48570,7 +48413,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -49261,7 +49104,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -50211,7 +50058,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50328,7 +50175,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50368,7 +50215,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -50438,7 +50285,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50553,7 +50400,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50593,7 +50440,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -50663,7 +50510,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -50779,7 +50626,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -50819,7 +50666,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -51149,7 +50996,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -51655,7 +51506,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -52013,7 +51868,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -52369,7 +52228,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -53194,7 +53057,11 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -53795,7 +53662,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -54154,7 +54025,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -54514,7 +54389,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -55656,7 +55535,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -55771,7 +55650,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55811,7 +55690,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -55876,7 +55755,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55917,7 +55796,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -55988,7 +55867,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56107,7 +55986,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56147,7 +56026,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56216,7 +56095,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56257,7 +56136,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56347,7 +56226,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56484,7 +56363,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56524,7 +56403,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56594,7 +56473,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56728,7 +56607,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56768,7 +56647,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -56838,7 +56717,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -56958,7 +56837,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -56998,7 +56877,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57068,7 +56947,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57191,7 +57070,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57231,7 +57110,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57301,7 +57180,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57422,7 +57301,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57462,7 +57341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57532,7 +57411,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57651,7 +57530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57691,7 +57570,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57761,7 +57640,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -57880,7 +57759,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57920,7 +57799,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -57990,7 +57869,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58107,7 +57986,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58148,7 +58027,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58294,7 +58173,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58445,7 +58324,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58485,7 +58364,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58555,7 +58434,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -58710,7 +58589,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58750,7 +58629,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58819,7 +58698,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58860,7 +58739,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -58931,7 +58810,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -59050,7 +58929,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59090,7 +58969,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -59159,7 +59038,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -59200,7 +59079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -60247,7 +60126,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -62046,7 +61929,7 @@ get names(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -62171,7 +62054,7 @@ get names(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -62212,7 +62095,7 @@ get names(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -62688,7 +62571,11 @@ get names(): ((string | LanguageString))[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -63371,7 +63258,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -63732,7 +63623,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64095,7 +63990,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64453,7 +64352,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -64811,7 +64714,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65169,7 +65076,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65527,7 +65438,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -65883,7 +65798,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66205,7 +66124,11 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66564,7 +66487,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -66861,7 +66788,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -66979,7 +66906,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67019,7 +66946,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -67112,7 +67039,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -67229,7 +67156,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -67269,7 +67196,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -67605,7 +67532,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -68005,7 +67936,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -68132,7 +68063,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68173,7 +68104,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -68431,7 +68362,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -68775,7 +68710,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -68902,7 +68837,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68943,7 +68878,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -69250,7 +69185,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -70492,7 +70431,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -70607,7 +70546,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70647,7 +70586,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -70712,7 +70651,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70753,7 +70692,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -70824,7 +70763,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -70943,7 +70882,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70983,7 +70922,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71052,7 +70991,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71093,7 +71032,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71183,7 +71122,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71320,7 +71259,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71360,7 +71299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71430,7 +71369,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71564,7 +71503,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71604,7 +71543,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71674,7 +71613,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -71794,7 +71733,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71834,7 +71773,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -71904,7 +71843,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72027,7 +71966,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72067,7 +72006,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72137,7 +72076,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72258,7 +72197,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72298,7 +72237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72368,7 +72307,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72487,7 +72426,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72527,7 +72466,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72597,7 +72536,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72716,7 +72655,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72756,7 +72695,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -72826,7 +72765,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -72943,7 +72882,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -72984,7 +72923,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73130,7 +73069,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73281,7 +73220,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73321,7 +73260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73391,7 +73330,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73546,7 +73485,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73586,7 +73525,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73655,7 +73594,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73696,7 +73635,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73767,7 +73706,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -73886,7 +73825,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73926,7 +73865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -73995,7 +73934,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -74036,7 +73975,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -75083,7 +75022,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -76533,7 +76476,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -77675,7 +77622,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -77790,7 +77737,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77830,7 +77777,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -77895,7 +77842,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -77936,7 +77883,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78007,7 +77954,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78126,7 +78073,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78166,7 +78113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78235,7 +78182,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78276,7 +78223,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78366,7 +78313,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78503,7 +78450,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78543,7 +78490,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78613,7 +78560,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78747,7 +78694,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78787,7 +78734,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -78857,7 +78804,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -78977,7 +78924,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79017,7 +78964,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79087,7 +79034,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79210,7 +79157,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79250,7 +79197,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79320,7 +79267,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79441,7 +79388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79481,7 +79428,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79551,7 +79498,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79670,7 +79617,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79710,7 +79657,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -79780,7 +79727,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -79899,7 +79846,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -79939,7 +79886,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80009,7 +79956,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80126,7 +80073,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80167,7 +80114,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80313,7 +80260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80464,7 +80411,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80504,7 +80451,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80574,7 +80521,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -80729,7 +80676,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80769,7 +80716,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80838,7 +80785,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -80879,7 +80826,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -80950,7 +80897,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -81069,7 +81016,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81109,7 +81056,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -81178,7 +81125,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -81219,7 +81166,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -82266,7 +82213,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -84172,7 +84123,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -84650,7 +84605,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -84767,7 +84722,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -84807,7 +84762,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -85063,7 +85018,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -85566,7 +85525,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -85685,7 +85644,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85726,7 +85685,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -85797,7 +85756,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -85916,7 +85875,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -85957,7 +85916,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -86058,7 +86017,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -86176,7 +86135,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86216,7 +86175,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -86309,7 +86268,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -86426,7 +86385,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -86466,7 +86425,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -86785,7 +86744,11 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -87481,7 +87444,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -87843,7 +87810,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -88261,7 +88232,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -88380,7 +88351,7 @@ relationships?: (Object | URL)[];} let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88420,7 +88391,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88490,7 +88461,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -88606,7 +88577,7 @@ relationships?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88646,7 +88617,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88712,7 +88683,7 @@ relationships?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88753,7 +88724,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -88824,7 +88795,7 @@ relationships?: (Object | URL)[];} document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -88942,7 +88913,7 @@ relationships?: (Object | URL)[];} let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -88982,7 +88953,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -89050,7 +89021,7 @@ relationships?: (Object | URL)[];} if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -89091,7 +89062,7 @@ relationships?: (Object | URL)[];} } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -89418,7 +89389,11 @@ relationships?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -89938,7 +89913,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -91080,7 +91059,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -91195,7 +91174,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91235,7 +91214,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91300,7 +91279,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91341,7 +91320,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91412,7 +91391,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -91531,7 +91510,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91571,7 +91550,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91640,7 +91619,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91681,7 +91660,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -91771,7 +91750,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -91908,7 +91887,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -91948,7 +91927,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92018,7 +91997,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92152,7 +92131,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92192,7 +92171,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92262,7 +92241,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92382,7 +92361,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92422,7 +92401,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92492,7 +92471,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92615,7 +92594,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92655,7 +92634,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92725,7 +92704,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -92846,7 +92825,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -92886,7 +92865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -92956,7 +92935,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93075,7 +93054,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93115,7 +93094,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93185,7 +93164,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93304,7 +93283,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93344,7 +93323,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93414,7 +93393,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93531,7 +93510,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93572,7 +93551,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93718,7 +93697,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -93869,7 +93848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -93909,7 +93888,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -93979,7 +93958,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -94134,7 +94113,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94174,7 +94153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94243,7 +94222,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94284,7 +94263,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94355,7 +94334,7 @@ get preferredUsernames(): ((string | LanguageString))[] { document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -94474,7 +94453,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94514,7 +94493,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -94583,7 +94562,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -94624,7 +94603,7 @@ get preferredUsernames(): ((string | LanguageString))[] { } if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -95671,7 +95650,11 @@ get preferredUsernames(): ((string | LanguageString))[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -97337,7 +97320,11 @@ get contents(): ((string | LanguageString))[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -97795,7 +97782,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -98153,7 +98144,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -98727,7 +98722,11 @@ get formerTypes(): ($EntityType)[] { } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99186,7 +99185,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99549,7 +99552,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -99910,7 +99917,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -100271,7 +100282,11 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); @@ -100628,7 +100643,11 @@ instruments?: (Object | URL)[];} } let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index c8f6aabda..fb33d90e2 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -14,6 +14,7 @@ const XSD_ANY_URI = "http://www.w3.org/2001/XMLSchema#anyURI"; const FEDIFY_URL = "fedify:url"; const RUNTIME_IMPORTS = [ "canParseDecimal", + "compactJsonLdCache", "decodeMultibase", "type Decimal", "type DocumentLoader", @@ -22,11 +23,13 @@ const RUNTIME_IMPORTS = [ "exportSpki", "formatIri", "getDocumentLoader", - "haveSameIriOrigin", + "getJsonLdContext", "importMultibaseKey", "importPem", "isDecimal", + "isTrustedIriOrigin", "LanguageString", + "normalizeJsonLdIris", "parseDecimal", "parseIri", "parseJsonLdId", @@ -249,18 +252,6 @@ export async function* generateClasses( isTemporalDuration, isTemporalInstant, } from "@fedify/vocab-runtime/temporal";\n`; - yield ` - -function hasTrustedIriOrigin( - options: { crossOrigin?: "ignore" | "throw" | "trust" }, - left: URL | null | undefined, - right: URL | null | undefined, -): boolean { - return options.crossOrigin === "trust" || left == null || - (right != null && haveSameIriOrigin(left, right)); -} - -`; const portableIriKeys = new Set(["@id", "id"]); for (const type of Object.values(types)) { for (const property of type.properties) { @@ -271,295 +262,6 @@ function hasTrustedIriOrigin( yield `const PORTABLE_IRI_KEYS: ReadonlySet = new Set(${ JSON.stringify([...portableIriKeys].sort()) });\n\n`; - yield `function isPortableIriValuePosition( - key: string, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): boolean { - return portableIriKeys.has(key) || - ((key === "@value" || key === "@list" || key === "@set") && - parentKey != null && portableIriKeys.has(parentKey)); -}\n\n`; - yield `function formatPortableIriForCache(value: string): string { - try { - return formatIri(value); - } catch { - return value; - } -}\n\n`; - yield `function normalizePortableIris( - value: unknown, - key?: string, - depth = 0, - parentKey?: string, - portableIriKeys: ReadonlySet = PORTABLE_IRI_KEYS, -): unknown { - if (depth > 32 || key === "@context") return value; - if (typeof value === "string") { - if ( - key != null && - isPortableIriValuePosition(key, parentKey, portableIriKeys) && - PORTABLE_IRI_PATTERN.test(value) - ) { - return formatPortableIriForCache(value); - } - return value; - } - if (Array.isArray(value)) { - let clone: unknown[] | undefined; - for (let i = 0; i < value.length; i++) { - const result = normalizePortableIris( - value[i], - key, - depth + 1, - parentKey, - portableIriKeys, - ); - if (result !== value[i]) { - clone ??= value.slice(0, i); - clone.push(result); - } else if (clone != null) { - clone.push(value[i]); - } - } - return clone ?? value; - } - if (value == null || typeof value !== "object") { - return value; - } - const object = value as Record; - let clone: Record | undefined; - for (const entryKey of globalThis.Object.keys(object)) { - const result = normalizePortableIris( - object[entryKey], - entryKey, - depth + 1, - key, - portableIriKeys, - ); - if (result !== object[entryKey]) { - clone ??= { ...object }; - clone[entryKey] = result; - } - } - return clone ?? object; -}\n\n`; - yield `function getJsonLdContext(value: unknown, depth = 0): unknown { - if (depth > 32) return undefined; - if (Array.isArray(value)) { - for (const item of value) { - const context = getJsonLdContext(item, depth + 1); - if (context !== undefined) return context; - } - return undefined; - } - if ( - value == null || typeof value !== "object" || - !("@context" in value) - ) { - return undefined; - } - return (value as Record)["@context"]; -}\n\n`; - yield `async function compactJsonLdCache( - normalized: unknown, - original: unknown, - documentLoader?: DocumentLoader, - depth = 0, -): Promise { - if (depth > 32) return normalized; - if (Array.isArray(original)) { - const normalizedArray = Array.isArray(normalized) - ? normalized - : normalized != null && typeof normalized === "object" && - "@graph" in normalized && - Array.isArray((normalized as Record)["@graph"]) - ? (normalized as Record)["@graph"] as unknown[] - : undefined; - if (normalizedArray == null) return normalized; - let clone: unknown[] | undefined; - for (let i = 0; i < normalizedArray.length; i++) { - const item = await compactJsonLdCache( - normalizedArray[i], - original[i], - documentLoader, - depth + 1, - ); - if (item !== normalizedArray[i]) { - clone ??= normalizedArray.slice(0, i); - clone.push(item); - } else if (clone != null) { - clone.push(normalizedArray[i]); - } - } - return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); - } - const context = getJsonLdContext(original); - if (context == null) return normalized; - return preserveJsonLdArrayShape( - await mergeUnmappedJsonLdTerms( - await jsonld.compact( - Array.isArray(normalized) && normalized.length === 1 - ? normalized[0] - : normalized, - context, - { - documentLoader, - }, - ), - original, - context, - documentLoader, - ), - original, - ); -}\n\n`; - yield `function getTopLevelJsonLdTerms(value: unknown): ReadonlySet { - const terms = new Set(); - const nodes = Array.isArray(value) ? value : [value]; - for (const node of nodes) { - if (node == null || typeof node !== "object" || Array.isArray(node)) { - continue; - } - for (const key of globalThis.Object.keys(node)) { - if (key.startsWith("@")) continue; - terms.add(key); - } - } - return terms; -}\n\n`; - yield `async function mergeUnmappedJsonLdTerms( - compacted: unknown, - original: unknown, - context: unknown, - documentLoader?: DocumentLoader, -): Promise { - if ( - original == null || typeof original !== "object" || - Array.isArray(original) || - compacted == null || typeof compacted !== "object" || - Array.isArray(compacted) - ) { - return compacted; - } - const result = { ...compacted as Record }; - const unmappedKeys = globalThis.Object.keys(original).filter((key) => - key !== "@context" && - !globalThis.Object.prototype.hasOwnProperty.call(result, key) - ); - if (unmappedKeys.length < 1) return result; - const compactedTerms = getTopLevelJsonLdTerms(await jsonld.expand(compacted, { - documentLoader, - })); - const dummyPrefix = "urn:fedify:dummy:"; - const dummy: Record = { "@context": context }; - for (let i = 0; i < unmappedKeys.length; i++) { - dummy[unmappedKeys[i]] = \`\${dummyPrefix}\${i}\`; - } - const expanded = await jsonld.expand(dummy, { documentLoader }); - const representedKeys = new Set(); - const nodes = Array.isArray(expanded) ? expanded : [expanded]; - for (const node of nodes) { - if (node == null || typeof node !== "object" || Array.isArray(node)) { - continue; - } - for (const [term, termValue] of globalThis.Object.entries(node)) { - if (!compactedTerms.has(term)) continue; - const value = JSON.stringify(termValue); - for (let i = 0; i < unmappedKeys.length; i++) { - if (value.includes(\`\${dummyPrefix}\${i}\`)) { - representedKeys.add(unmappedKeys[i]); - } - } - } - } - for (const key of unmappedKeys) { - if (!representedKeys.has(key)) { - const value = (original as Record)[key]; - result[key] = structuredClone(value); - } - } - return result; -}\n\n`; - yield `function preserveJsonLdArrayShape( - compacted: unknown, - original: unknown, - depth = 0, -): unknown { - if (depth > 32) return compacted; - if ( - original == null || typeof original !== "object" || - compacted == null || typeof compacted !== "object" - ) { - return compacted; - } - if (Array.isArray(original)) { - const compactedArray = Array.isArray(compacted) - ? compacted - : "@graph" in compacted && - Array.isArray((compacted as Record)["@graph"]) - ? (compacted as Record)["@graph"] as unknown[] - : undefined; - if (compactedArray == null) return compacted; - let clone: unknown[] | undefined; - for (let i = 0; i < compactedArray.length; i++) { - const value = preserveJsonLdArrayShape( - compactedArray[i], - original[i], - depth + 1, - ); - const originalContext = original[i] != null && - typeof original[i] === "object" && !Array.isArray(original[i]) && - "@context" in original[i] - ? (original[i] as Record)["@context"] - : undefined; - const shaped = originalContext !== undefined && - value != null && typeof value === "object" && - !Array.isArray(value) && !("@context" in value) - ? { "@context": originalContext, ...value as Record } - : value; - if (shaped !== compactedArray[i]) { - clone ??= compactedArray.slice(0, i); - clone.push(shaped); - } else if (clone != null) { - clone.push(compactedArray[i]); - } - } - return clone ?? (Array.isArray(compacted) ? compacted : compactedArray); - } - if (Array.isArray(compacted)) return compacted; - let clone: Record | undefined; - const compactedObject = compacted as Record; - const originalObject = original as Record; - for (const key of globalThis.Object.keys(compactedObject)) { - if (key === "@context") continue; - const value = preserveJsonLdArrayShape( - compactedObject[key], - originalObject[key], - depth + 1, - ); - const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) - ? [value] - : value; - if (shaped !== compactedObject[key]) { - clone ??= { ...compactedObject }; - clone[key] = shaped; - } - } - if (depth > 0) { - for (const key of globalThis.Object.keys(originalObject)) { - if ( - key.startsWith("@") || - globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) - ) { - continue; - } - clone ??= { ...compactedObject }; - clone[key] = structuredClone(originalObject[key]); - } - } - return clone ?? compactedObject; -}\n\n`; const moduleVarNames = new Map(); const sorted = sortTopologically(types); for (const typeUri of sorted) { diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index 0e5d598b6..b025044b5 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -434,7 +434,11 @@ export async function* generateDecoder( `; yield ` let cacheJsonLd = !("_fromSubclass" in options) || !options._fromSubclass - ? normalizePortableIris(expanded) + ? normalizeJsonLdIris( + expanded, + PORTABLE_IRI_KEYS, + PORTABLE_IRI_PATTERN, + ) : undefined; if (cacheJsonLd != null && cacheJsonLd !== expanded) { cacheJsonLd = structuredClone(cacheJsonLd); diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index 65a21eb63..e5215fa02 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -111,7 +111,7 @@ async function* generateProperty( document, { documentLoader, contextLoader, tracerProvider, baseUrl } ); - if (obj?.id != null && !hasTrustedIriOrigin(options, obj.id, baseUrl)) { + if (obj?.id != null && !isTrustedIriOrigin(options, obj.id, baseUrl)) { if (options.crossOrigin === "throw") { throw new Error( "The object's @id (" + obj.id.href + ") has a different origin " + @@ -276,7 +276,7 @@ async function* generateProperty( let v = this.${await getFieldName(property.uri)}[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !hasTrustedIriOrigin(options, v.id, this.id)) && + (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { v = v.id; } @@ -316,7 +316,7 @@ async function* generateProperty( } yield ` if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { if (options.crossOrigin === "throw") { throw new Error( @@ -383,7 +383,7 @@ async function* generateProperty( if (!(v instanceof URL) && v.id != null && (this.id == null || - !hasTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id)) && !this.${await getFieldName(property.uri, "#_trust")}.has(i)) { v = v.id; } @@ -424,7 +424,7 @@ async function* generateProperty( } yield ` if (v?.id != null && - this.id != null && !hasTrustedIriOrigin(options, v.id, this.id) && + this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { if (options.crossOrigin === "throw") { throw new Error( From c2490d1a8e3929eba015324e907eb86d27318f05 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 22:41:08 +0900 Subject: [PATCH 42/55] Keep cache helpers internal Keep the generated vocabulary cache helpers out of the root @fedify/vocab-runtime API while still exposing them through an explicit internal subpath for generated classes. The helpers now carry @internal JSDoc that says they are not part of the public API contract and are not considered public API for Semantic Versioning decisions. The generated classes import these helpers from the internal subpath, and the runtime package exports and builds that subpath for Deno, Node.js, and Bun. https://github.com/fedify-dev/fedify/pull/850#pullrequestreview-4616181669 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/deno.json | 1 + packages/vocab-runtime/package.json | 10 +++++++ .../src/{ => internal}/jsonld-cache.ts | 26 ++++++++++++++++--- .../vocab-runtime/src/jsonld-cache.test.ts | 2 +- packages/vocab-runtime/src/mod.ts | 7 ----- packages/vocab-runtime/tsdown.config.ts | 7 ++++- .../src/__snapshots__/class.test.ts.deno.snap | 10 ++++--- .../src/__snapshots__/class.test.ts.node.snap | 10 ++++--- .../src/__snapshots__/class.test.ts.snap | 10 ++++--- packages/vocab-tools/src/class.ts | 11 +++++--- 10 files changed, 66 insertions(+), 28 deletions(-) rename packages/vocab-runtime/src/{ => internal}/jsonld-cache.ts (89%) diff --git a/packages/vocab-runtime/deno.json b/packages/vocab-runtime/deno.json index ed0b883cf..6f56da282 100644 --- a/packages/vocab-runtime/deno.json +++ b/packages/vocab-runtime/deno.json @@ -4,6 +4,7 @@ "license": "MIT", "exports": { ".": "./src/mod.ts", + "./internal/jsonld-cache": "./src/internal/jsonld-cache.ts", "./jsonld": "./src/jsonld.ts", "./temporal": "./src/temporal.ts" }, diff --git a/packages/vocab-runtime/package.json b/packages/vocab-runtime/package.json index c2a3a39fb..92b9c2656 100644 --- a/packages/vocab-runtime/package.json +++ b/packages/vocab-runtime/package.json @@ -42,6 +42,16 @@ "require": "./dist/jsonld.cjs", "default": "./dist/jsonld.js" }, + "./internal/jsonld-cache": { + "types": { + "import": "./dist/internal/jsonld-cache.d.ts", + "require": "./dist/internal/jsonld-cache.d.cts", + "default": "./dist/internal/jsonld-cache.d.ts" + }, + "import": "./dist/internal/jsonld-cache.js", + "require": "./dist/internal/jsonld-cache.cjs", + "default": "./dist/internal/jsonld-cache.js" + }, "./temporal": { "types": { "import": "./dist/temporal.d.ts", diff --git a/packages/vocab-runtime/src/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts similarity index 89% rename from packages/vocab-runtime/src/jsonld-cache.ts rename to packages/vocab-runtime/src/internal/jsonld-cache.ts index a6c5f9d6c..39df5d8e3 100644 --- a/packages/vocab-runtime/src/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -1,9 +1,13 @@ -import type { DocumentLoader } from "./docloader.ts"; -import jsonld from "./jsonld.ts"; -import { formatIri, haveSameIriOrigin } from "./url.ts"; +import type { DocumentLoader } from "../docloader.ts"; +import jsonld from "../jsonld.ts"; +import { formatIri, haveSameIriOrigin } from "../url.ts"; /** * Options for deciding whether two IRIs should be treated as same-origin. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. */ export interface IriTrustOptions { crossOrigin?: "ignore" | "throw" | "trust"; @@ -11,6 +15,10 @@ export interface IriTrustOptions { /** * Checks whether an IRI is trusted relative to another IRI. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. */ export function isTrustedIriOrigin( options: IriTrustOptions, @@ -23,6 +31,10 @@ export function isTrustedIriOrigin( /** * Normalizes portable IRIs in JSON-LD cache data. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. */ export function normalizeJsonLdIris( value: unknown, @@ -85,6 +97,10 @@ export function normalizeJsonLdIris( /** * Finds the first JSON-LD context in a value. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. */ export function getJsonLdContext(value: unknown, depth = 0): unknown { if (depth > 32) return undefined; @@ -106,6 +122,10 @@ export function getJsonLdContext(value: unknown, depth = 0): unknown { /** * Recompacts normalized JSON-LD cache data against the original context. + * + * @internal Technically exported for generated vocabulary classes, but not + * part of the public API contract. This is not considered public API for + * Semantic Versioning decisions. */ export async function compactJsonLdCache( normalized: unknown, diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index 6cff4c13a..883ca9fa0 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -5,7 +5,7 @@ import { getJsonLdContext, isTrustedIriOrigin, normalizeJsonLdIris, -} from "./jsonld-cache.ts"; +} from "./internal/jsonld-cache.ts"; import jsonld from "./jsonld.ts"; import { parseIri } from "./url.ts"; diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index f45d3a5c4..f81321ff6 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -61,10 +61,3 @@ export { UrlError, validatePublicUrl, } from "./url.ts"; -export { - compactJsonLdCache, - getJsonLdContext, - type IriTrustOptions, - isTrustedIriOrigin, - normalizeJsonLdIris, -} from "./jsonld-cache.ts"; diff --git a/packages/vocab-runtime/tsdown.config.ts b/packages/vocab-runtime/tsdown.config.ts index 3726e6eda..4e23314be 100644 --- a/packages/vocab-runtime/tsdown.config.ts +++ b/packages/vocab-runtime/tsdown.config.ts @@ -4,7 +4,12 @@ import { defineConfig } from "tsdown"; export default [ defineConfig({ - entry: ["src/mod.ts", "src/jsonld.ts", "src/temporal.ts"], + entry: [ + "src/mod.ts", + "src/internal/jsonld-cache.ts", + "src/jsonld.ts", + "src/temporal.ts", + ], dts: { compilerOptions: { isolatedDeclarations: true, declaration: true } }, format: ["esm", "cjs"], platform: "neutral", diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index feabdcf37..9d39713f5 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -8,7 +8,6 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from \\"@opentelemetry/api\\"; import { canParseDecimal, - compactJsonLdCache, decodeMultibase, type Decimal, type DocumentLoader, @@ -17,18 +16,21 @@ import { exportSpki, formatIri, getDocumentLoader, - getJsonLdContext, importMultibaseKey, importPem, isDecimal, - isTrustedIriOrigin, LanguageString, - normalizeJsonLdIris, parseDecimal, parseIri, parseJsonLdId, type RemoteDocument } from \\"@fedify/vocab-runtime\\"; +import { + compactJsonLdCache, + getJsonLdContext, + isTrustedIriOrigin, + normalizeJsonLdIris +} from \\"@fedify/vocab-runtime/internal/jsonld-cache\\"; import { isTemporalDuration, isTemporalInstant, diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index fd5ed4f5f..781413191 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -6,7 +6,6 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from \\"@opentelemetry/api\\"; import { canParseDecimal, - compactJsonLdCache, decodeMultibase, type Decimal, type DocumentLoader, @@ -15,18 +14,21 @@ import { exportSpki, formatIri, getDocumentLoader, - getJsonLdContext, importMultibaseKey, importPem, isDecimal, - isTrustedIriOrigin, LanguageString, - normalizeJsonLdIris, parseDecimal, parseIri, parseJsonLdId, type RemoteDocument } from \\"@fedify/vocab-runtime\\"; +import { + compactJsonLdCache, + getJsonLdContext, + isTrustedIriOrigin, + normalizeJsonLdIris +} from \\"@fedify/vocab-runtime/internal/jsonld-cache\\"; import { isTemporalDuration, isTemporalInstant, diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 9a77364e1..93eab236b 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -8,7 +8,6 @@ import { type Span, SpanStatusCode, type TracerProvider, trace } from "@opentelemetry/api"; import { canParseDecimal, - compactJsonLdCache, decodeMultibase, type Decimal, type DocumentLoader, @@ -17,18 +16,21 @@ import { exportSpki, formatIri, getDocumentLoader, - getJsonLdContext, importMultibaseKey, importPem, isDecimal, - isTrustedIriOrigin, LanguageString, - normalizeJsonLdIris, parseDecimal, parseIri, parseJsonLdId, type RemoteDocument } from "@fedify/vocab-runtime"; +import { + compactJsonLdCache, + getJsonLdContext, + isTrustedIriOrigin, + normalizeJsonLdIris +} from "@fedify/vocab-runtime/internal/jsonld-cache"; import { isTemporalDuration, isTemporalInstant, diff --git a/packages/vocab-tools/src/class.ts b/packages/vocab-tools/src/class.ts index fb33d90e2..e8ae007dc 100644 --- a/packages/vocab-tools/src/class.ts +++ b/packages/vocab-tools/src/class.ts @@ -12,9 +12,14 @@ import { emitOverride } from "./type.ts"; const XSD_ANY_URI = "http://www.w3.org/2001/XMLSchema#anyURI"; const FEDIFY_URL = "fedify:url"; +const INTERNAL_RUNTIME_IMPORTS = [ + "compactJsonLdCache", + "getJsonLdContext", + "isTrustedIriOrigin", + "normalizeJsonLdIris", +].join(",\n "); const RUNTIME_IMPORTS = [ "canParseDecimal", - "compactJsonLdCache", "decodeMultibase", "type Decimal", "type DocumentLoader", @@ -23,13 +28,10 @@ const RUNTIME_IMPORTS = [ "exportSpki", "formatIri", "getDocumentLoader", - "getJsonLdContext", "importMultibaseKey", "importPem", "isDecimal", - "isTrustedIriOrigin", "LanguageString", - "normalizeJsonLdIris", "parseDecimal", "parseIri", "parseJsonLdId", @@ -248,6 +250,7 @@ export async function* generateClasses( yield `import { type Span, SpanStatusCode, type TracerProvider, trace } from "@opentelemetry/api";\n`; yield `import {\n ${RUNTIME_IMPORTS}\n} from "@fedify/vocab-runtime";\n`; + yield `import {\n ${INTERNAL_RUNTIME_IMPORTS}\n} from "@fedify/vocab-runtime/internal/jsonld-cache";\n`; yield `import { isTemporalDuration, isTemporalInstant, From 8716ed41559bfae5b3d52fa6edaf7df0dd131680 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 22:43:03 +0900 Subject: [PATCH 43/55] Avoid dummy marker prefix collisions Compare dummy marker values exactly when deciding which unmapped JSON-LD terms are already represented by compacted terms. The previous substring check could treat urn:fedify:dummy:10 as a match for urn:fedify:dummy:1 and skip copying back unrelated extension properties. The regression test covers more than ten unmapped terms so prefix collisions are exercised directly. https://github.com/fedify-dev/fedify/pull/850#discussion_r3513359193 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 14 +++++- .../vocab-runtime/src/jsonld-cache.test.ts | 46 +++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index 39df5d8e3..4c7c8edc6 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -233,9 +233,8 @@ async function mergeUnmappedTerms( } for (const [term, termValue] of globalThis.Object.entries(node)) { if (!compactedTerms.has(term)) continue; - const value = JSON.stringify(termValue); for (let i = 0; i < unmappedKeys.length; i++) { - if (value.includes(`${dummyPrefix}${i}`)) { + if (containsValue(termValue, `${dummyPrefix}${i}`)) { representedKeys.add(unmappedKeys[i]); } } @@ -251,6 +250,17 @@ async function mergeUnmappedTerms( return result; } +function containsValue(value: unknown, expected: string): boolean { + if (value === expected) return true; + if (Array.isArray(value)) { + return value.some((item) => containsValue(item, expected)); + } + if (value == null || typeof value !== "object") return false; + return globalThis.Object.values(value).some((item) => + containsValue(item, expected) + ); +} + function preserveJsonLdShape( compacted: unknown, original: unknown, diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index 883ca9fa0..05f4daf86 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -92,3 +92,49 @@ test("compactJsonLdCache() preserves nested unmapped terms", async () => { }, }); }); + +test("compactJsonLdCache() does not confuse dummy marker prefixes", async () => { + const context = { + ex: "https://example.com/ns#", + id: "@id", + represented: "ex:represented", + key10: "ex:represented", + }; + const original = { + "@context": context, + id: "ap://did:key:z6Mkabc/objects/1", + represented: "Compacted term already present.", + key0: "Extension 0", + key1: "Extension 1", + key2: "Extension 2", + key3: "Extension 3", + key4: "Extension 4", + key5: "Extension 5", + key6: "Extension 6", + key7: "Extension 7", + key8: "Extension 8", + key9: "Extension 9", + key10: "Alias represented by the compacted term.", + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + + deepStrictEqual(await compactJsonLdCache(normalized, original), { + "@context": context, + id: "ap+ef61://did:key:z6Mkabc/objects/1", + key0: "Extension 0", + key1: "Extension 1", + key2: "Extension 2", + key3: "Extension 3", + key4: "Extension 4", + key5: "Extension 5", + key6: "Extension 6", + key7: "Extension 7", + key8: "Extension 8", + key9: "Extension 9", + key10: [ + "Alias represented by the compacted term.", + "Compacted term already present.", + ], + }); +}); From 93250480cca25ba9fd13874ed0d967b51bcb2599 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 23:03:07 +0900 Subject: [PATCH 44/55] Validate portable IRI cache edges Validate URLs again after resolving relative IRIs against portable bases so network-path references cannot bypass DID authority checks. Preserve encoded DID-internal delimiters while decoding encoded DID authority separators, and avoid cloning unchanged unmapped JSON-LD cache values. https://github.com/fedify-dev/fedify/pull/850#discussion_r3513568560 https://github.com/fedify-dev/fedify/pull/850#discussion_r3513585920 https://github.com/fedify-dev/fedify/pull/850#discussion_r3513585941 https://github.com/fedify-dev/fedify/pull/850#discussion_r3513585946 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 6 ++-- .../vocab-runtime/src/jsonld-cache.test.ts | 34 ++++++++++++++++++- packages/vocab-runtime/src/url.test.ts | 17 ++++++++++ packages/vocab-runtime/src/url.ts | 8 +++-- 4 files changed, 58 insertions(+), 7 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index 4c7c8edc6..40c617fac 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -242,9 +242,7 @@ async function mergeUnmappedTerms( } for (const key of unmappedKeys) { if (!representedKeys.has(key)) { - result[key] = structuredClone( - (original as Record)[key], - ); + result[key] = (original as Record)[key]; } } return result; @@ -335,7 +333,7 @@ function preserveJsonLdShape( continue; } clone ??= { ...compactedObject }; - clone[key] = structuredClone(originalObject[key]); + clone[key] = originalObject[key]; } } return clone ?? compactedObject; diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index 05f4daf86..4a3e1b1c0 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -1,4 +1,4 @@ -import { deepStrictEqual, ok } from "node:assert"; +import { deepStrictEqual, ok, strictEqual } from "node:assert"; import { test } from "node:test"; import { compactJsonLdCache, @@ -93,6 +93,38 @@ test("compactJsonLdCache() preserves nested unmapped terms", async () => { }); }); +test("compactJsonLdCache() reuses unchanged unmapped values", async () => { + const context = { + as: "https://www.w3.org/ns/activitystreams#", + id: "@id", + type: "@type", + attachment: { "@id": "as:attachment" }, + name: "as:name", + }; + const extra = { source: "unchanged nested extension" }; + const rootExtra = { source: "unchanged root extension" }; + const original = { + "@context": context, + type: "as:Note", + id: "ap://did:key:z6Mkabc/objects/1", + rootExtra, + attachment: { + type: "as:Object", + name: "Attachment with an unmapped extension.", + extra, + }, + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + const compacted = await compactJsonLdCache(normalized, original) as { + rootExtra: unknown; + attachment: { extra: unknown }; + }; + + strictEqual(compacted.rootExtra, rootExtra); + strictEqual(compacted.attachment.extra, extra); +}); + test("compactJsonLdCache() does not confuse dummy marker prefixes", async () => { const context = { ex: "https://example.com/ns#", diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index df0febdc8..d85a0e9f5 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -97,6 +97,11 @@ test("parseIri() resolves relative IRIs against portable string bases", () => { parseIri("attachments/1", "ap://did:key:z6Mkabc/objects/1"), new URL("ap+ef61://did%3Akey%3Az6Mkabc/objects/attachments/1"), ); + ok(!canParseIri("//example.com/outbox", "ap://did:key:z6Mkabc/objects/1")); + throws( + () => parseIri("//example.com/outbox", "ap://did:key:z6Mkabc/objects/1"), + TypeError, + ); }); test("parseIri() resolves relative IRIs against at:// string bases", () => { @@ -227,6 +232,18 @@ test("parseIri() accepts portable DID URLs with encoded DID delimiters", () => { ); }); +test("parseIri() decodes pct-encoded DID delimiters in order", () => { + const parsed = parseIri("ap://did%3Aweb%3Aexample.com%253A3000/u/1"); + deepStrictEqual( + parsed, + new URL("ap+ef61://did%3Aweb%3Aexample.com%253A3000/u/1"), + ); + deepStrictEqual( + formatIri(parsed), + "ap+ef61://did:web:example.com%3A3000/u/1", + ); +}); + test("validatePublicUrl()", async () => { await rejects(() => validatePublicUrl("ftp://localhost"), UrlError); await rejects( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 01d32c6f4..24c6f605e 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -55,7 +55,8 @@ export function parseIri(iri: string | URL, base?: string | URL): URL { if (!URL.canParse(iri, base) && iri.startsWith("at://")) { return parseAtUri(iri); } - return new URL(iri, base); + const parsed = new URL(iri, base); + return normalizePortableUrl(parsed) ?? parsed; } /** @@ -137,7 +138,10 @@ function decodePortableAuthority(authority: string): string { } return decoded; } - const decoded = authority.replace(/%3A/gi, ":").replace(/%25/gi, "%"); + const decoded = authority + .replace(/%25/gi, "\0") + .replace(/%3A/gi, ":") + .replaceAll("\0", "%"); if (INVALID_PERCENT_ENCODING_PATTERN.test(decoded)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } From 1327197ab6a22dc4a00781228298c188de7f4d63 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 23:24:41 +0900 Subject: [PATCH 45/55] Preserve nested cache trust state Keep recursive JSON-LD cache scans bounded and avoid walking nested contexts while checking dummy marker values. Nested cache shape recovery now uses the same unmapped-term check as the top-level merge, so already represented aliases are not copied back with raw portable IRI values. Also check plural fetched-object trust by item index instead of always checking index zero. https://github.com/fedify-dev/fedify/pull/850#discussion_r3513694144 https://github.com/fedify-dev/fedify/pull/850#discussion_r3513694153 https://github.com/fedify-dev/fedify/pull/850#discussion_r3513694162 https://github.com/fedify-dev/fedify/pull/850#discussion_r3513724318 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 74 ++++++++---- .../vocab-runtime/src/jsonld-cache.test.ts | 79 +++++++++++++ .../src/__snapshots__/class.test.ts.deno.snap | 110 +++++++++--------- .../src/__snapshots__/class.test.ts.node.snap | 110 +++++++++--------- .../src/__snapshots__/class.test.ts.snap | 110 +++++++++--------- packages/vocab-tools/src/property.ts | 2 +- packages/vocab/src/vocab.test.ts | 41 +++++++ 7 files changed, 338 insertions(+), 188 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index 40c617fac..1289c9686 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -132,6 +132,7 @@ export async function compactJsonLdCache( original: unknown, documentLoader?: DocumentLoader, depth = 0, + inheritedContext?: unknown, ): Promise { if (depth > 32) return normalized; if (Array.isArray(original)) { @@ -150,6 +151,7 @@ export async function compactJsonLdCache( original[i], documentLoader, depth + 1, + inheritedContext, ); if (item !== normalizedArray[i]) { clone ??= normalizedArray.slice(0, i); @@ -160,9 +162,10 @@ export async function compactJsonLdCache( } return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); } - const context = getJsonLdContext(original); + const ownContext = getJsonLdContext(original); + const context = ownContext ?? inheritedContext; if (context == null) return normalized; - return preserveJsonLdShape( + return await preserveJsonLdShape( await mergeUnmappedTerms( await jsonld.compact( Array.isArray(normalized) && normalized.length === 1 @@ -176,6 +179,9 @@ export async function compactJsonLdCache( documentLoader, ), original, + context, + documentLoader, + depth, ); } @@ -214,10 +220,13 @@ async function mergeUnmappedTerms( !globalThis.Object.prototype.hasOwnProperty.call(result, key) ); if (unmappedKeys.length < 1) return result; + const compactedWithContext = compacted != null && + typeof compacted === "object" && !Array.isArray(compacted) && + !("@context" in compacted) + ? { "@context": context, ...compacted as Record } + : compacted; const compactedTerms = getTopLevelTerms( - await jsonld.expand(compacted, { - documentLoader, - }), + await jsonld.expand(compactedWithContext, { documentLoader }), ); const dummyPrefix = "urn:fedify:dummy:"; const dummy: Record = { "@context": context }; @@ -248,23 +257,27 @@ async function mergeUnmappedTerms( return result; } -function containsValue(value: unknown, expected: string): boolean { +function containsValue(value: unknown, expected: string, depth = 0): boolean { + if (depth > 32) return false; if (value === expected) return true; if (Array.isArray(value)) { - return value.some((item) => containsValue(item, expected)); + return value.some((item) => containsValue(item, expected, depth + 1)); } if (value == null || typeof value !== "object") return false; - return globalThis.Object.values(value).some((item) => - containsValue(item, expected) + return globalThis.Object.entries(value).some(([key, item]) => + key !== "@context" && containsValue(item, expected, depth + 1) ); } -function preserveJsonLdShape( +async function preserveJsonLdShape( compacted: unknown, original: unknown, + context: unknown, + documentLoader?: DocumentLoader, depth = 0, -): unknown { +): Promise { if (depth > 32) return compacted; + if (compacted === original) return compacted; if ( original == null || typeof original !== "object" || compacted == null || typeof compacted !== "object" @@ -281,9 +294,11 @@ function preserveJsonLdShape( if (compactedArray == null) return compacted; let clone: unknown[] | undefined; for (let i = 0; i < compactedArray.length; i++) { - const value = preserveJsonLdShape( + const value = await preserveJsonLdShape( compactedArray[i], original[i], + context, + documentLoader, depth + 1, ); const originalContext = original[i] != null && @@ -307,13 +322,22 @@ function preserveJsonLdShape( } if (Array.isArray(compacted)) return compacted; let clone: Record | undefined; - const compactedObject = compacted as Record; + const compactedObject = depth > 0 + ? await mergeUnmappedTerms( + compacted, + original, + combineContexts(context, getJsonLdContext(original)), + documentLoader, + ) as Record + : compacted as Record; const originalObject = original as Record; for (const key of globalThis.Object.keys(compactedObject)) { if (key === "@context") continue; - const value = preserveJsonLdShape( + const value = await preserveJsonLdShape( compactedObject[key], originalObject[key], + context, + documentLoader, depth + 1, ); const shaped = Array.isArray(originalObject[key]) && !Array.isArray(value) @@ -325,16 +349,22 @@ function preserveJsonLdShape( } } if (depth > 0) { - for (const key of globalThis.Object.keys(originalObject)) { - if ( - key.startsWith("@") || - globalThis.Object.prototype.hasOwnProperty.call(compactedObject, key) - ) { - continue; - } + if ("@context" in originalObject && !("@context" in compactedObject)) { clone ??= { ...compactedObject }; - clone[key] = originalObject[key]; + clone["@context"] = originalObject["@context"]; } } return clone ?? compactedObject; } + +function combineContexts( + inheritedContext: unknown, + ownContext: unknown, +): unknown { + if (ownContext == null || ownContext === inheritedContext) { + return inheritedContext; + } + return Array.isArray(inheritedContext) + ? [...inheritedContext, ownContext] + : [inheritedContext, ownContext]; +} diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index 4a3e1b1c0..a3ff394d8 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -125,6 +125,85 @@ test("compactJsonLdCache() reuses unchanged unmapped values", async () => { strictEqual(compacted.attachment.extra, extra); }); +test("compactJsonLdCache() preserves nested contexts", async () => { + const context = { + as: "https://www.w3.org/ns/activitystreams#", + id: "@id", + type: "@type", + attachment: { "@id": "as:attachment" }, + name: "as:name", + }; + const nestedContext = { + id: "@id", + type: "@type", + title: "https://example.com/ns#title", + }; + const original = { + "@context": context, + type: "as:Note", + id: "ap://did:key:z6Mkabc/objects/1", + attachment: { + "@context": nestedContext, + type: "as:Object", + title: "Nested title.", + }, + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + + deepStrictEqual(await compactJsonLdCache(normalized, original), { + "@context": context, + type: "as:Note", + id: "ap+ef61://did:key:z6Mkabc/objects/1", + attachment: { + "@context": nestedContext, + type: "as:Object", + "https://example.com/ns#title": "Nested title.", + }, + }); +}); + +test("compactJsonLdCache() does not re-add represented nested aliases", async () => { + const context = { + as: "https://www.w3.org/ns/activitystreams#", + id: "@id", + type: "@type", + attachment: { "@id": "as:attachment" }, + actor: { "@id": "as:actor", "@type": "@id" }, + }; + const nestedContext = { + id: "@id", + type: "@type", + actorRef: { "@id": "as:actor", "@type": "@id" }, + }; + const original = { + "@context": context, + type: "as:Note", + id: "ap://did:key:z6Mkabc/objects/1", + attachment: { + "@context": nestedContext, + type: "as:Object", + actorRef: "ap://did:key:z6Mkabc/actor", + }, + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris( + expanded, + new Set(["@id", "https://www.w3.org/ns/activitystreams#actor"]), + ); + + deepStrictEqual(await compactJsonLdCache(normalized, original), { + "@context": context, + type: "as:Note", + id: "ap+ef61://did:key:z6Mkabc/objects/1", + attachment: { + "@context": nestedContext, + type: "as:Object", + actor: "ap+ef61://did:key:z6Mkabc/actor", + }, + }); +}); + test("compactJsonLdCache() does not confuse dummy marker prefixes", async () => { const context = { ex: "https://example.com/ns#", diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 9d39713f5..40f969d57 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -2371,7 +2371,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { + !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -2745,7 +2745,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3081,7 +3081,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3354,7 +3354,7 @@ get contents(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { + !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3634,7 +3634,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { + !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3993,7 +3993,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4352,7 +4352,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4697,7 +4697,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5042,7 +5042,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5385,7 +5385,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6599,7 +6599,7 @@ get summaries(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { + !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6969,7 +6969,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7305,7 +7305,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7641,7 +7641,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7977,7 +7977,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -8375,7 +8375,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -15497,7 +15497,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -15835,7 +15835,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -16179,7 +16179,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -16517,7 +16517,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -16857,7 +16857,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -17193,7 +17193,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -36085,7 +36085,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -36425,7 +36425,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -38316,7 +38316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -39028,7 +39028,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -39368,7 +39368,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -46607,7 +46607,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -55799,7 +55799,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -56139,7 +56139,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -58030,7 +58030,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -58742,7 +58742,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -59082,7 +59082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -62098,7 +62098,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68107,7 +68107,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68881,7 +68881,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -70695,7 +70695,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -71035,7 +71035,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -72926,7 +72926,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73638,7 +73638,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73978,7 +73978,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -77886,7 +77886,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -78226,7 +78226,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -80117,7 +80117,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -80829,7 +80829,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -81169,7 +81169,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -85688,7 +85688,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { + !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -85919,7 +85919,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { + !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -88727,7 +88727,7 @@ relationships?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -89065,7 +89065,7 @@ relationships?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91323,7 +91323,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91663,7 +91663,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -93554,7 +93554,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94266,7 +94266,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94606,7 +94606,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 781413191..ba996773c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -2369,7 +2369,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { + !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -2743,7 +2743,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3079,7 +3079,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3352,7 +3352,7 @@ get contents(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { + !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3632,7 +3632,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { + !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -3991,7 +3991,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4350,7 +4350,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -4695,7 +4695,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5040,7 +5040,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -5383,7 +5383,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6597,7 +6597,7 @@ get summaries(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { + !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -6967,7 +6967,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7303,7 +7303,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7639,7 +7639,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -7975,7 +7975,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -8373,7 +8373,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -15495,7 +15495,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -15833,7 +15833,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -16177,7 +16177,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -16515,7 +16515,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -16855,7 +16855,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -17191,7 +17191,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -36083,7 +36083,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -36423,7 +36423,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -38314,7 +38314,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -39026,7 +39026,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -39366,7 +39366,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -46605,7 +46605,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -55797,7 +55797,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -56137,7 +56137,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -58028,7 +58028,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -58740,7 +58740,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -59080,7 +59080,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -62096,7 +62096,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68105,7 +68105,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -68879,7 +68879,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -70693,7 +70693,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -71033,7 +71033,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -72924,7 +72924,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73636,7 +73636,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -73976,7 +73976,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -77884,7 +77884,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -78224,7 +78224,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -80115,7 +80115,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -80827,7 +80827,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -81167,7 +81167,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -85686,7 +85686,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { + !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -85917,7 +85917,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { + !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -88725,7 +88725,7 @@ relationships?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -89063,7 +89063,7 @@ relationships?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91321,7 +91321,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -91661,7 +91661,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -93552,7 +93552,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94264,7 +94264,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + @@ -94604,7 +94604,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === \\"throw\\") { throw new Error( \\"The property object's @id (\\" + v.id.href + \\") has a different \\" + diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 93eab236b..7435e0753 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -2371,7 +2371,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(0)) { + !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -2745,7 +2745,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { + !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -3081,7 +3081,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { + !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -3354,7 +3354,7 @@ get contents(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(0)) { + !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -3634,7 +3634,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(0)) { + !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -3993,7 +3993,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { + !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -4352,7 +4352,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { + !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -4697,7 +4697,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { + !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -5042,7 +5042,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { + !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -5385,7 +5385,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -6599,7 +6599,7 @@ get summaries(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(0)) { + !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -6969,7 +6969,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { + !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -7305,7 +7305,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { + !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -7641,7 +7641,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { + !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -7977,7 +7977,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { + !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -8375,7 +8375,7 @@ get urls(): ((URL | Link))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { + !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -15497,7 +15497,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { + !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -15835,7 +15835,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -16179,7 +16179,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { + !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -16517,7 +16517,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { + !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -16857,7 +16857,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { + !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -17193,7 +17193,7 @@ instruments?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { + !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -36085,7 +36085,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -36425,7 +36425,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -38316,7 +38316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -39028,7 +39028,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -39368,7 +39368,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -46607,7 +46607,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -55799,7 +55799,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -56139,7 +56139,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -58030,7 +58030,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -58742,7 +58742,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -59082,7 +59082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -62098,7 +62098,7 @@ get names(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { + !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -68107,7 +68107,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -68881,7 +68881,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(0)) { + !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -70695,7 +70695,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -71035,7 +71035,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -72926,7 +72926,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -73638,7 +73638,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -73978,7 +73978,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -77886,7 +77886,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -78226,7 +78226,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -80117,7 +80117,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -80829,7 +80829,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -81169,7 +81169,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -85688,7 +85688,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(0)) { + !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -85919,7 +85919,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(0)) { + !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -88727,7 +88727,7 @@ relationships?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { + !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -89065,7 +89065,7 @@ relationships?: (Object | URL)[];} if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { + !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -91323,7 +91323,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { + !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -91663,7 +91663,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { + !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -93554,7 +93554,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(0)) { + !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -94266,7 +94266,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { + !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + @@ -94606,7 +94606,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { + !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index e5215fa02..fb4e01802 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -425,7 +425,7 @@ async function* generateProperty( yield ` if (v?.id != null && this.id != null && !isTrustedIriOrigin(options, v.id, this.id) && - !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { + !this.${await getFieldName(property.uri, "#_trust")}.has(i)) { if (options.crossOrigin === "throw") { throw new Error( "The property object's @id (" + v.id.href + ") has a different " + diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index c796cc856..c138235f8 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -1194,6 +1194,7 @@ test("fromJsonLd() formats portable IRIs hidden behind nested remote contexts", unknown >; deepStrictEqual(jsonLd.extraContainer, { + "@context": nestedContextUrl, content: "This text mentions ap://did:key:z6Mkabc/text.", extra: "This nested extension object should stay cached.", extraRef: { id: "ap+ef61://did:key:z6Mkabc/extra" }, @@ -1257,9 +1258,11 @@ test("fromJsonLd() formats portable IRIs in sibling remote-context objects", asy unknown >; deepStrictEqual(jsonLd.firstExtraContainer, { + "@context": nestedContextUrl, content: "No portable IRI here.", }); deepStrictEqual(jsonLd.secondExtraContainer, { + "@context": nestedContextUrl, extraRef: { id: "ap+ef61://did:key:z6Mkabc/second" }, }); }); @@ -3653,6 +3656,44 @@ test("FEP-fe34: Array properties with crossOrigin trust option", async () => { deepStrictEqual((items[1] as Note).content, "Legitimate note 2"); }); +test("FEP-fe34: Array properties track trust per item", async () => { + const collection = new Collection({ + id: new URL("https://example.com/collection"), + items: [ + new Note({ + id: new URL("https://malicious.com/fake-note1"), + content: "Trusted constructor note 1", + }), + new URL("https://different-origin.com/note2"), + ], + }); + // deno-lint-ignore require-await + const documentLoader = async (url: string) => { + if (url === "https://different-origin.com/note2") { + return { + documentUrl: url, + contextUrl: null, + document: { + "@context": "https://www.w3.org/ns/activitystreams", + "@type": "Note", + "@id": "https://malicious.com/fake-note2", + "content": "Untrusted fetched note 2", + }, + }; + } + throw new Error("Document not found"); + }; + + const items = []; + for await (const item of collection.getItems({ documentLoader })) { + items.push(item); + } + + deepStrictEqual(items.length, 1); + assertInstanceOf(items[0], Note); + deepStrictEqual((items[0] as Note).content, "Trusted constructor note 1"); +}); + test( "FEP-fe34: Embedded objects in arrays from JSON-LD respect cross-origin policy", async () => { From b1c99e5743afe6797e07015567a9e9707b7045e2 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 23:40:58 +0900 Subject: [PATCH 46/55] Normalize DID scheme in origins Portable ActivityPub IRIs accept the DID scheme case-insensitively. Use lowercase did: only for comparable origin keys so uppercase DID: and lowercase did: authorities do not look cross-origin. https://github.com/fedify-dev/fedify/pull/850#discussion_r3513878914 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/url.test.ts | 8 ++++++++ packages/vocab-runtime/src/url.ts | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index d85a0e9f5..818684417 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -150,6 +150,14 @@ test("haveSameIriOrigin() compares portable IRI authorities", () => { new URL("ap://did%3Akey%3Az6Mkabc/actor"), new URL("ap+ef61://did%3Akey%3Az6Mkabc/outbox"), )); + ok(haveSameIriOrigin( + parseIri("ap://DID:key:z6Mkabc/actor"), + parseIri("ap://did:key:z6Mkabc/outbox"), + )); + ok(haveSameIriOrigin( + new URL("ap+ef61://DID%3Akey%3Az6Mkabc/actor"), + new URL("ap+ef61://did%3Akey%3Az6Mkabc/outbox"), + )); ok( !haveSameIriOrigin( parseIri("ap://did:key:z6Mkabc/actor"), diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 24c6f605e..4f8133062 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -85,7 +85,14 @@ export function haveSameIriOrigin(left: URL, right: URL): boolean { function getComparableIriOrigin(iri: URL): string { iri = normalizePortableUrl(iri) ?? iri; if (iri.origin !== "null") return iri.origin; - if (iri.host !== "") return `${iri.protocol}//${iri.host}`; + if (iri.host !== "") { + const host = iri.protocol === "ap+ef61:" + ? encodeURIComponent( + decodePortableAuthority(iri.host).replace(DID_SCHEME_PATTERN, "did:"), + ) + : iri.host; + return `${iri.protocol}//${host}`; + } return iri.href; } From 6fb8a1c0d03d33cbd8382ea676c034d2da2ae556 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Thu, 2 Jul 2026 23:55:38 +0900 Subject: [PATCH 47/55] Guard cache merge edge keys Define unmapped JSON-LD cache keys with property descriptors so prototype-like extension names cannot trigger object prototype setters. Decode portable IRI authorities with a callback replacement instead of a sentinel byte so percent escapes are handled without collision-prone intermediate state. https://github.com/fedify-dev/fedify/pull/850#discussion_r3513962996 https://github.com/fedify-dev/fedify/pull/850#discussion_r3513963010 https://github.com/fedify-dev/fedify/pull/850#discussion_r3513963032 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 21 ++++- .../vocab-runtime/src/jsonld-cache.test.ts | 80 +++++++++++++++++++ packages/vocab-runtime/src/url.test.ts | 12 +++ packages/vocab-runtime/src/url.ts | 8 +- 4 files changed, 115 insertions(+), 6 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index 1289c9686..e62ecc3f9 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -231,7 +231,7 @@ async function mergeUnmappedTerms( const dummyPrefix = "urn:fedify:dummy:"; const dummy: Record = { "@context": context }; for (let i = 0; i < unmappedKeys.length; i++) { - dummy[unmappedKeys[i]] = `${dummyPrefix}${i}`; + defineJsonLdProperty(dummy, unmappedKeys[i], `${dummyPrefix}${i}`); } const expanded = await jsonld.expand(dummy, { documentLoader }); const representedKeys = new Set(); @@ -251,12 +251,29 @@ async function mergeUnmappedTerms( } for (const key of unmappedKeys) { if (!representedKeys.has(key)) { - result[key] = (original as Record)[key]; + defineJsonLdProperty( + result, + key, + (original as Record)[key], + ); } } return result; } +function defineJsonLdProperty( + object: Record, + key: string, + value: unknown, +): void { + globalThis.Object.defineProperty(object, key, { + value, + enumerable: true, + configurable: true, + writable: true, + }); +} + function containsValue(value: unknown, expected: string, depth = 0): boolean { if (depth > 32) return false; if (value === expected) return true; diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index a3ff394d8..715f9442b 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -125,6 +125,86 @@ test("compactJsonLdCache() reuses unchanged unmapped values", async () => { strictEqual(compacted.attachment.extra, extra); }); +test("compactJsonLdCache() defines prototype-like unmapped keys safely", async () => { + const context = { + id: "@id", + type: "@type", + }; + const protoValue = { source: "own __proto__ extension" }; + const original: Record = { + "@context": context, + type: "https://example.com/ns#Object", + id: "ap://did:key:z6Mkabc/objects/1", + }; + globalThis.Object.defineProperty(original, "__proto__", { + value: protoValue, + enumerable: true, + configurable: true, + writable: true, + }); + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + const compacted = await compactJsonLdCache(normalized, original) as Record< + string, + unknown + >; + + strictEqual( + globalThis.Object.getOwnPropertyDescriptor(compacted, "__proto__")?.value, + protoValue, + ); + strictEqual(globalThis.Object.getPrototypeOf(compacted), Object.prototype); +}); + +test("compactJsonLdCache() checks prototype-like aliases safely", async () => { + const context: Record = { + ex: "https://example.com/ns#", + id: "@id", + represented: "ex:represented", + }; + globalThis.Object.defineProperty(context, "__proto__", { + value: "ex:represented", + enumerable: true, + configurable: true, + writable: true, + }); + const original: Record = { + "@context": context, + id: "ap://did:key:z6Mkabc/objects/1", + represented: "Compacted term already present.", + }; + globalThis.Object.defineProperty(original, "__proto__", { + value: "Alias represented by the compacted term.", + enumerable: true, + configurable: true, + writable: true, + }); + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + const compacted = await compactJsonLdCache(normalized, original) as Record< + string, + unknown + >; + + const protoDescriptor = globalThis.Object.getOwnPropertyDescriptor( + compacted, + "__proto__", + ); + ok( + protoDescriptor?.value === "Alias represented by the compacted term." || + Array.isArray(protoDescriptor?.value) && + protoDescriptor.value.includes( + "Alias represented by the compacted term.", + ), + ); + strictEqual(protoDescriptor?.enumerable, true); + strictEqual(compacted.id, "ap+ef61://did:key:z6Mkabc/objects/1"); + strictEqual( + globalThis.Object.getPrototypeOf(compacted), + Object.prototype, + ); +}); + test("compactJsonLdCache() preserves nested contexts", async () => { const context = { as: "https://www.w3.org/ns/activitystreams#", diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 818684417..00effa9fb 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -252,6 +252,18 @@ test("parseIri() decodes pct-encoded DID delimiters in order", () => { ); }); +test("parseIri() preserves encoded percent signs while decoding delimiters", () => { + const parsed = parseIri("ap://did%3Aweb%3Aexample.com%2500/u/1"); + deepStrictEqual( + parsed, + new URL("ap+ef61://did%3Aweb%3Aexample.com%2500/u/1"), + ); + deepStrictEqual( + formatIri(parsed), + "ap+ef61://did:web:example.com%00/u/1", + ); +}); + test("validatePublicUrl()", async () => { await rejects(() => validatePublicUrl("ftp://localhost"), UrlError); await rejects( diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 4f8133062..8bd9785ff 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -145,10 +145,10 @@ function decodePortableAuthority(authority: string): string { } return decoded; } - const decoded = authority - .replace(/%25/gi, "\0") - .replace(/%3A/gi, ":") - .replaceAll("\0", "%"); + const decoded = authority.replace( + /%(25|3A)/gi, + (match) => match.toLowerCase() === "%3a" ? ":" : "%", + ); if (INVALID_PERCENT_ENCODING_PATTERN.test(decoded)) { throw new TypeError("Invalid portable ActivityPub IRI authority."); } From 65ade6ea6080ca32d0263947144a65b80d0015fb Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 3 Jul 2026 00:14:56 +0900 Subject: [PATCH 48/55] Preserve no-context cache shape Keep no-context JSON-LD cache entries in the caller's object shape when portable IRIs require normalization. Single-item array inputs are still wrapped by the generated codec so existing expanded array caches keep their array shape. https://github.com/fedify-dev/fedify/pull/850#issuecomment-4867198946 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 93 ++++- .../vocab-runtime/src/jsonld-cache.test.ts | 32 ++ .../src/__snapshots__/class.test.ts.deno.snap | 324 +++++------------- .../src/__snapshots__/class.test.ts.node.snap | 324 +++++------------- .../src/__snapshots__/class.test.ts.snap | 324 +++++------------- packages/vocab-tools/src/codec.ts | 4 +- packages/vocab/src/vocab.test.ts | 30 ++ 7 files changed, 398 insertions(+), 733 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index e62ecc3f9..972f32466 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -164,7 +164,9 @@ export async function compactJsonLdCache( } const ownContext = getJsonLdContext(original); const context = ownContext ?? inheritedContext; - if (context == null) return normalized; + if (context == null) { + return preserveNoContextJsonLdShape(normalized, original, depth); + } return await preserveJsonLdShape( await mergeUnmappedTerms( await jsonld.compact( @@ -185,6 +187,95 @@ export async function compactJsonLdCache( ); } +function preserveNoContextJsonLdShape( + normalized: unknown, + original: unknown, + depth = 0, +): unknown { + if (depth > 32) return normalized; + if ( + original == null || typeof original !== "object" || + Array.isArray(original) + ) { + return normalized; + } + const normalizedObject = Array.isArray(normalized) && normalized.length === 1 + ? normalized[0] + : normalized; + if ( + normalizedObject == null || typeof normalizedObject !== "object" || + Array.isArray(normalizedObject) + ) { + return normalized; + } + const source = normalizedObject as Record; + const originalObject = original as Record; + let clone: Record | undefined; + for (const key of globalThis.Object.keys(originalObject)) { + if (!globalThis.Object.prototype.hasOwnProperty.call(source, key)) { + continue; + } + const value = preserveNoContextValue( + source[key], + originalObject[key], + depth + 1, + ); + if (value !== originalObject[key]) { + clone ??= { ...originalObject }; + clone[key] = value; + } + } + return clone ?? original; +} + +function preserveNoContextValue( + normalized: unknown, + original: unknown, + depth: number, +): unknown { + if (depth > 32) return normalized; + if (Array.isArray(original)) { + const normalizedArray = Array.isArray(normalized) + ? normalized + : [normalized]; + let clone: unknown[] | undefined; + for (let i = 0; i < original.length; i++) { + const value = preserveNoContextValue( + normalizedArray[i], + original[i], + depth + 1, + ); + if (value !== original[i]) { + clone ??= original.slice(0, i); + clone.push(value); + } else if (clone != null) { + clone.push(original[i]); + } + } + return clone ?? original; + } + const normalizedValue = Array.isArray(normalized) + ? normalized[0] + : normalized; + if ( + normalizedValue == null || typeof normalizedValue !== "object" || + Array.isArray(normalizedValue) + ) { + return normalizedValue; + } + const normalizedObject = normalizedValue as Record; + if ( + original != null && typeof original === "object" && !Array.isArray(original) + ) { + return preserveNoContextJsonLdShape(normalizedObject, original, depth + 1); + } + if (typeof normalizedObject["@id"] === "string") { + return normalizedObject["@id"]; + } + if ("@value" in normalizedObject) return normalizedObject["@value"]; + return normalizedValue; +} + function getTopLevelTerms(value: unknown): ReadonlySet { const terms = new Set(); const nodes = Array.isArray(value) ? value : [value]; diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index 715f9442b..73ec1a1fc 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -60,6 +60,38 @@ test("getJsonLdContext() finds nested contexts", () => { ); }); +test("compactJsonLdCache() preserves no-context object shape", async () => { + const original = { + "@id": "ap://did:key:z6Mkabc/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attributedTo": [ + { "@id": "ap://did:key:z6Mkabc/actor" }, + ], + "https://www.w3.org/ns/activitystreams#content": [ + { "@value": "No-context object shape should stay cached." }, + ], + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris( + expanded, + new Set([ + "@id", + "https://www.w3.org/ns/activitystreams#attributedTo", + ]), + ); + + deepStrictEqual(await compactJsonLdCache(normalized, original), { + "@id": "ap+ef61://did:key:z6Mkabc/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attributedTo": [ + { "@id": "ap+ef61://did:key:z6Mkabc/actor" }, + ], + "https://www.w3.org/ns/activitystreams#content": [ + { "@value": "No-context object shape should stay cached." }, + ], + }); +}); + test("compactJsonLdCache() preserves nested unmapped terms", async () => { const context = { as: "https://www.w3.org/ns/activitystreams#", diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 40f969d57..942fd5ac3 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -12071,9 +12071,7 @@ get urls(): ((URL | Link))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13295,9 +13293,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14429,9 +14425,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17854,9 +17848,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18371,9 +18363,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18954,9 +18944,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19565,9 +19553,7 @@ unit?: string | null;numericalValue?: Decimal | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20635,9 +20621,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21046,9 +21030,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21753,9 +21735,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22490,9 +22470,7 @@ get manualApprovals(): (URL)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23571,9 +23549,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23981,9 +23957,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24995,9 +24969,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25405,9 +25377,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26418,9 +26388,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26828,9 +26796,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27327,9 +27293,7 @@ get endpoints(): (URL)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27676,9 +27640,7 @@ endpoints?: (URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28632,9 +28594,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29604,9 +29564,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30527,9 +30485,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31157,9 +31113,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31765,9 +31719,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32665,9 +32617,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33534,9 +33484,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33981,9 +33929,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34345,9 +34291,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34708,9 +34652,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41062,9 +41004,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41909,9 +41849,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42272,9 +42210,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43401,9 +43337,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44030,9 +43964,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44435,9 +44367,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44801,9 +44731,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45165,9 +45093,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -49525,9 +49451,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51119,9 +51043,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51539,9 +51461,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51901,9 +51821,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52261,9 +52179,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53195,9 +53111,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53695,9 +53609,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54058,9 +53970,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54422,9 +54332,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -60776,9 +60684,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -62773,9 +62679,7 @@ get names(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63291,9 +63195,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63656,9 +63558,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64023,9 +63923,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64385,9 +64283,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64747,9 +64643,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65109,9 +65003,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65471,9 +65363,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65831,9 +65721,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66157,9 +66045,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66520,9 +66406,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67651,9 +67535,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68435,9 +68317,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69276,9 +69156,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -75672,9 +75550,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76509,9 +76385,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -82863,9 +82737,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -84270,9 +84142,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85081,9 +84951,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -86972,9 +86840,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87477,9 +87343,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87843,9 +87707,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -89512,9 +89374,7 @@ relationships?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -89946,9 +89806,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -96300,9 +96158,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97392,9 +97248,7 @@ get contents(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97815,9 +97669,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98177,9 +98029,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98808,9 +98658,7 @@ get formerTypes(): (\$EntityType)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99218,9 +99066,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99585,9 +99431,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99950,9 +99794,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100315,9 +100157,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100676,9 +100516,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index ba996773c..9aac42fa3 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -12069,9 +12069,7 @@ get urls(): ((URL | Link))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13293,9 +13291,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14427,9 +14423,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17852,9 +17846,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18369,9 +18361,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18952,9 +18942,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19563,9 +19551,7 @@ unit?: string | null;numericalValue?: Decimal | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20633,9 +20619,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21044,9 +21028,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21751,9 +21733,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22488,9 +22468,7 @@ get manualApprovals(): (URL)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23569,9 +23547,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23979,9 +23955,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24993,9 +24967,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25403,9 +25375,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26416,9 +26386,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26826,9 +26794,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27325,9 +27291,7 @@ get endpoints(): (URL)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27674,9 +27638,7 @@ endpoints?: (URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28630,9 +28592,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29602,9 +29562,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30525,9 +30483,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31155,9 +31111,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31763,9 +31717,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32663,9 +32615,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33532,9 +33482,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33979,9 +33927,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34343,9 +34289,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34706,9 +34650,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41060,9 +41002,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41907,9 +41847,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42270,9 +42208,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43399,9 +43335,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44028,9 +43962,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44433,9 +44365,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44799,9 +44729,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45163,9 +45091,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -49523,9 +49449,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51117,9 +51041,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51537,9 +51459,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51899,9 +51819,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52259,9 +52177,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53193,9 +53109,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53693,9 +53607,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54056,9 +53968,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54420,9 +54330,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -60774,9 +60682,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -62771,9 +62677,7 @@ get names(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63289,9 +63193,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63654,9 +63556,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64021,9 +63921,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64383,9 +64281,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64745,9 +64641,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65107,9 +65001,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65469,9 +65361,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65829,9 +65719,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66155,9 +66043,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66518,9 +66404,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67649,9 +67533,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68433,9 +68315,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69274,9 +69154,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -75670,9 +75548,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76507,9 +76383,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -82861,9 +82735,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -84268,9 +84140,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85079,9 +84949,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -86970,9 +86838,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87475,9 +87341,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87841,9 +87705,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -89510,9 +89372,7 @@ relationships?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -89944,9 +89804,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -96298,9 +96156,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97390,9 +97246,7 @@ get contents(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97813,9 +97667,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98175,9 +98027,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98806,9 +98656,7 @@ get formerTypes(): ($EntityType)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99216,9 +99064,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99583,9 +99429,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99948,9 +99792,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100313,9 +100155,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100674,9 +100514,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 7435e0753..5a57ae361 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -12071,9 +12071,7 @@ get urls(): ((URL | Link))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -13295,9 +13293,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -14429,9 +14425,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -17854,9 +17848,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18371,9 +18363,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -18954,9 +18944,7 @@ name?: string | LanguageString | null;value?: string | LanguageString | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -19565,9 +19553,7 @@ unit?: string | null;numericalValue?: Decimal | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -20635,9 +20621,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21046,9 +21030,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -21753,9 +21735,7 @@ canLike?: InteractionRule | null;canReply?: InteractionRule | null;canAnnounce?: jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -22490,9 +22470,7 @@ get manualApprovals(): (URL)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23571,9 +23549,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -23981,9 +23957,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -24995,9 +24969,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -25405,9 +25377,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26418,9 +26388,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -26828,9 +26796,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27327,9 +27293,7 @@ get endpoints(): (URL)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -27676,9 +27640,7 @@ endpoints?: (URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -28632,9 +28594,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -29604,9 +29564,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -30527,9 +30485,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31157,9 +31113,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -31765,9 +31719,7 @@ satisfies?: URL | null;resourceQuantity?: Measure | null;} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -32665,9 +32617,7 @@ action?: string | null;resourceConformsTo?: URL | null;resourceQuantity?: Measur jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33534,9 +33484,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -33981,9 +33929,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34345,9 +34291,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -34708,9 +34652,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41062,9 +41004,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -41909,9 +41849,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -42272,9 +42210,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -43401,9 +43337,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44030,9 +43964,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44435,9 +44367,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -44801,9 +44731,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -45165,9 +45093,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -49525,9 +49451,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51119,9 +51043,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51539,9 +51461,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -51901,9 +51821,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -52261,9 +52179,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53195,9 +53111,7 @@ proxyUrl?: URL | null;oauthAuthorizationEndpoint?: URL | null;oauthTokenEndpoint jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -53695,9 +53609,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54058,9 +53970,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -54422,9 +54332,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -60776,9 +60684,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -62773,9 +62679,7 @@ get names(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63291,9 +63195,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -63656,9 +63558,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64023,9 +63923,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64385,9 +64283,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -64747,9 +64643,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65109,9 +65003,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65471,9 +65363,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -65831,9 +65721,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66157,9 +66045,7 @@ names?: ((string | LanguageString))[];language?: Intl.Locale | null;height?: num jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -66520,9 +66406,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -67651,9 +67535,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -68435,9 +68317,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -69276,9 +69156,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -75672,9 +75550,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -76509,9 +76385,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -82863,9 +82737,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -84270,9 +84142,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -85081,9 +84951,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -86972,9 +86840,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87477,9 +87343,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -87843,9 +87707,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -89512,9 +89374,7 @@ relationships?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -89946,9 +89806,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -96300,9 +96158,7 @@ get preferredUsernames(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97392,9 +97248,7 @@ get contents(): ((string | LanguageString))[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -97815,9 +97669,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98177,9 +98029,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -98808,9 +98658,7 @@ get formerTypes(): ($EntityType)[] { jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99218,9 +99066,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99585,9 +99431,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -99950,9 +99794,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100315,9 +100157,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } @@ -100676,9 +100516,7 @@ instruments?: (Object | URL)[];} jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab-tools/src/codec.ts b/packages/vocab-tools/src/codec.ts index b025044b5..f7038c965 100644 --- a/packages/vocab-tools/src/codec.ts +++ b/packages/vocab-tools/src/codec.ts @@ -558,9 +558,7 @@ export async function* generateDecoder( jsonLd, options.contextLoader, ); - instance._cachedJsonLd = compactArray && getJsonLdContext(jsonLd) != null - ? [cachedJsonLd] - : cachedJsonLd; + instance._cachedJsonLd = compactArray ? [cachedJsonLd] : cachedJsonLd; } else { instance._cachedJsonLd = structuredClone(json); } diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index c138235f8..11d7be40c 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -741,6 +741,36 @@ test("fromJsonLd() preserves single-node expanded arrays with portable IRIs", as deepStrictEqual(expanded[0]["@id"], "ap://did:key:z6Mkabc/objects/1"); }); +test("fromJsonLd() preserves no-context object shape with portable IRIs", async () => { + const expanded = { + "@id": "ap://did:key:z6Mkabc/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attributedTo": [ + { "@id": "ap://did:key:z6Mkabc/actor" }, + ], + "https://www.w3.org/ns/activitystreams#content": [ + { "@value": "No-context object shape should stay cached." }, + ], + }; + + const note = await Note.fromJsonLd(expanded, { + documentLoader: mockDocumentLoader, + contextLoader: mockDocumentLoader, + }); + + deepStrictEqual(await note.toJsonLd(), { + "@id": "ap+ef61://did:key:z6Mkabc/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attributedTo": [ + { "@id": "ap+ef61://did:key:z6Mkabc/actor" }, + ], + "https://www.w3.org/ns/activitystreams#content": [ + { "@value": "No-context object shape should stay cached." }, + ], + }); + deepStrictEqual(expanded["@id"], "ap://did:key:z6Mkabc/objects/1"); +}); + test("fromJsonLd() preserves expanded subtype cache types", async () => { const expanded = [ { From 3aa32abe7352137a5d537bbf23c8b0ae794c84cf Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 3 Jul 2026 00:33:20 +0900 Subject: [PATCH 49/55] Guard cache clone edge keys Use property descriptors when lazy JSON-LD cache clones write normalized values, so prototype-like keys such as __proto__ remain own data properties instead of invoking object prototype setters. https://github.com/fedify-dev/fedify/pull/850#discussion_r3514185299 https://github.com/fedify-dev/fedify/pull/850#discussion_r3514185323 https://github.com/fedify-dev/fedify/pull/850#discussion_r3514185332 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 6 +-- .../vocab-runtime/src/jsonld-cache.test.ts | 54 +++++++++++++++++++ 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index 972f32466..42ac4d44b 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -88,7 +88,7 @@ export function normalizeJsonLdIris( const result = normalize(object[entryKey], entryKey, depth + 1, key); if (result !== object[entryKey]) { clone ??= { ...object }; - clone[entryKey] = result; + defineJsonLdProperty(clone, entryKey, result); } } return clone ?? object; @@ -222,7 +222,7 @@ function preserveNoContextJsonLdShape( ); if (value !== originalObject[key]) { clone ??= { ...originalObject }; - clone[key] = value; + defineJsonLdProperty(clone, key, value); } } return clone ?? original; @@ -453,7 +453,7 @@ async function preserveJsonLdShape( : value; if (shaped !== compactedObject[key]) { clone ??= { ...compactedObject }; - clone[key] = shaped; + defineJsonLdProperty(clone, key, shaped); } } if (depth > 0) { diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index 73ec1a1fc..6bf9f6224 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -52,6 +52,28 @@ test("normalizeJsonLdIris() normalizes selected JSON-LD IRI positions", () => { }); }); +test("normalizeJsonLdIris() defines prototype-like keys safely", () => { + const iriKeys = new Set(["__proto__"]); + const value: Record = {}; + globalThis.Object.defineProperty(value, "__proto__", { + value: "ap://did:key:z6Mkabc/object", + enumerable: true, + configurable: true, + writable: true, + }); + + const normalized = normalizeJsonLdIris(value, iriKeys) as Record< + string, + unknown + >; + + strictEqual( + globalThis.Object.getOwnPropertyDescriptor(normalized, "__proto__")?.value, + "ap+ef61://did:key:z6Mkabc/object", + ); + strictEqual(globalThis.Object.getPrototypeOf(normalized), Object.prototype); +}); + test("getJsonLdContext() finds nested contexts", () => { const context = { name: "https://example.com/ns#name" }; deepStrictEqual( @@ -92,6 +114,38 @@ test("compactJsonLdCache() preserves no-context object shape", async () => { }); }); +test("compactJsonLdCache() defines no-context prototype-like keys safely", async () => { + const original: Record = { + "@id": "ap://did:key:z6Mkabc/objects/1", + }; + globalThis.Object.defineProperty(original, "__proto__", { + value: "ap://did:key:z6Mkabc/proto", + enumerable: true, + configurable: true, + writable: true, + }); + const normalized: Record = { + "@id": "ap+ef61://did:key:z6Mkabc/objects/1", + }; + globalThis.Object.defineProperty(normalized, "__proto__", { + value: "ap+ef61://did:key:z6Mkabc/proto", + enumerable: true, + configurable: true, + writable: true, + }); + + const compacted = await compactJsonLdCache([normalized], original) as Record< + string, + unknown + >; + + strictEqual( + globalThis.Object.getOwnPropertyDescriptor(compacted, "__proto__")?.value, + "ap+ef61://did:key:z6Mkabc/proto", + ); + strictEqual(globalThis.Object.getPrototypeOf(compacted), Object.prototype); +}); + test("compactJsonLdCache() preserves nested unmapped terms", async () => { const context = { as: "https://www.w3.org/ns/activitystreams#", From 02426e572025caba67d17f36eef824420113631c Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 3 Jul 2026 00:59:18 +0900 Subject: [PATCH 50/55] Preserve IRI list context Carry the enclosing IRI property through JSON-LD @list and @set wrappers while normalizing cache data, so expanded value containers preserve the canonical portable IRI spelling. https://github.com/fedify-dev/fedify/pull/850#discussion_r3514328030 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 26 +++++++++++++-- .../vocab-runtime/src/jsonld-cache.test.ts | 33 +++++++++++++++++++ packages/vocab/src/vocab.test.ts | 30 +++++++++++++++++ 3 files changed, 87 insertions(+), 2 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index 42ac4d44b..32ee3d86c 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -49,6 +49,22 @@ export function normalizeJsonLdIris( parentKey != null && iriKeys.has(parentKey)); } + function arrayItemParentKey( + key?: string, + parentKey?: string, + ): string | undefined { + return key === "@list" || key === "@set" ? parentKey : key; + } + + function entryParentKey( + entryKey: string, + key?: string, + parentKey?: string, + ): string | undefined { + if (entryKey === "@list" || entryKey === "@set") return parentKey ?? key; + return key === "@list" || key === "@set" ? parentKey : key; + } + function normalize( value: unknown, key?: string, @@ -70,8 +86,9 @@ export function normalizeJsonLdIris( } if (Array.isArray(value)) { let clone: unknown[] | undefined; + const itemParentKey = arrayItemParentKey(key, parentKey); for (let i = 0; i < value.length; i++) { - const result = normalize(value[i], key, depth + 1, parentKey); + const result = normalize(value[i], key, depth + 1, itemParentKey); if (result !== value[i]) { clone ??= value.slice(0, i); clone.push(result); @@ -85,7 +102,12 @@ export function normalizeJsonLdIris( const object = value as Record; let clone: Record | undefined; for (const entryKey of globalThis.Object.keys(object)) { - const result = normalize(object[entryKey], entryKey, depth + 1, key); + const result = normalize( + object[entryKey], + entryKey, + depth + 1, + entryParentKey(entryKey, key, parentKey), + ); if (result !== object[entryKey]) { clone ??= { ...object }; defineJsonLdProperty(clone, entryKey, result); diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index 6bf9f6224..eb7d32c35 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -52,6 +52,39 @@ test("normalizeJsonLdIris() normalizes selected JSON-LD IRI positions", () => { }); }); +test("normalizeJsonLdIris() preserves IRI context in list/set wrappers", () => { + const iriKeys = new Set(["https://example.com/ns#ref"]); + const value = { + "https://example.com/ns#ref": [ + { + "@list": [ + { "@value": "ap://did:key:z6Mkabc/listed" }, + ], + }, + { + "@set": [ + { "@value": "ap://did:key:z6Mkabc/set" }, + ], + }, + ], + }; + + deepStrictEqual(normalizeJsonLdIris(value, iriKeys), { + "https://example.com/ns#ref": [ + { + "@list": [ + { "@value": "ap+ef61://did:key:z6Mkabc/listed" }, + ], + }, + { + "@set": [ + { "@value": "ap+ef61://did:key:z6Mkabc/set" }, + ], + }, + ], + }); +}); + test("normalizeJsonLdIris() defines prototype-like keys safely", () => { const iriKeys = new Set(["__proto__"]); const value: Record = {}; diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 11d7be40c..fb1466cae 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -1411,6 +1411,36 @@ test("fromJsonLd() formats portable IRIs in scalar URL values", async () => { deepStrictEqual(jsonLd.quoteUrl, "ap+ef61://did:key:z6Mkabc/objects/1"); }); +test("fromJsonLd() formats portable IRIs in URL value lists", async () => { + const note = await Note.fromJsonLd({ + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://gotosocial.org/ns", + { quoteUrl: "as:quoteUrl" }, + ], + type: "Note", + id: "https://example.com/notes/1", + quoteUrl: { + "@list": [ + { "@value": "ap://did:key:z6Mkabc/objects/1" }, + ], + }, + }, { documentLoader: mockDocumentLoader, contextLoader: mockDocumentLoader }); + + deepStrictEqual( + note.quoteUrl, + new URL("ap+ef61://did%3Akey%3Az6Mkabc/objects/1"), + ); + const jsonLd = await note.toJsonLd({ + contextLoader: mockDocumentLoader, + }) as Record; + deepStrictEqual(jsonLd.quoteUrl, { + "@list": [ + "ap+ef61://did:key:z6Mkabc/objects/1", + ], + }); +}); + test({ name: "Activity.getObject()", permissions: { env: true, read: true }, From 96937a5d7c20abdefb6bc8be42fb9618afe0841e Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 3 Jul 2026 01:36:01 +0900 Subject: [PATCH 51/55] Tighten portable IRI internals Remove the unused canParseIri runtime export, keep no-context cache compaction from borrowing nested child contexts, and fetch portable IRI references through their canonical external spelling. https://github.com/fedify-dev/fedify/pull/850#pullrequestreview-4619100041 https://github.com/fedify-dev/fedify/pull/850#discussion_r3514491334 https://github.com/fedify-dev/fedify/pull/850#discussion_r3514491336 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 14 +- .../vocab-runtime/src/jsonld-cache.test.ts | 32 + packages/vocab-runtime/src/mod.ts | 1 - packages/vocab-runtime/src/url.test.ts | 21 +- packages/vocab-runtime/src/url.ts | 12 - .../src/__snapshots__/class.test.ts.deno.snap | 959 ++++++++++-------- .../src/__snapshots__/class.test.ts.node.snap | 959 ++++++++++-------- .../src/__snapshots__/class.test.ts.snap | 959 ++++++++++-------- packages/vocab-tools/src/property.ts | 7 +- packages/vocab/src/vocab.test.ts | 33 +- 10 files changed, 1732 insertions(+), 1265 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index 32ee3d86c..dc2b2e42b 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -142,6 +142,16 @@ export function getJsonLdContext(value: unknown, depth = 0): unknown { return (value as Record)["@context"]; } +function getOwnJsonLdContext(value: unknown): unknown { + if ( + value == null || typeof value !== "object" || Array.isArray(value) || + !("@context" in value) + ) { + return undefined; + } + return (value as Record)["@context"]; +} + /** * Recompacts normalized JSON-LD cache data against the original context. * @@ -184,7 +194,7 @@ export async function compactJsonLdCache( } return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); } - const ownContext = getJsonLdContext(original); + const ownContext = getOwnJsonLdContext(original); const context = ownContext ?? inheritedContext; if (context == null) { return preserveNoContextJsonLdShape(normalized, original, depth); @@ -456,7 +466,7 @@ async function preserveJsonLdShape( ? await mergeUnmappedTerms( compacted, original, - combineContexts(context, getJsonLdContext(original)), + combineContexts(context, getOwnJsonLdContext(original)), documentLoader, ) as Record : compacted as Record; diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index eb7d32c35..cce1e1d89 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -147,6 +147,38 @@ test("compactJsonLdCache() preserves no-context object shape", async () => { }); }); +test("compactJsonLdCache() ignores nested contexts for no-context parents", async () => { + const nestedContext = { + type: "@type", + name: "https://www.w3.org/ns/activitystreams#name", + }; + const original = { + "@id": "ap://did:key:z6Mkabc/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attachment": [ + { + "@context": nestedContext, + type: "https://www.w3.org/ns/activitystreams#Object", + name: "Nested object", + }, + ], + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + + deepStrictEqual(await compactJsonLdCache(normalized, original), { + "@id": "ap+ef61://did:key:z6Mkabc/objects/1", + "@type": ["https://www.w3.org/ns/activitystreams#Note"], + "https://www.w3.org/ns/activitystreams#attachment": [ + { + "@context": nestedContext, + type: "https://www.w3.org/ns/activitystreams#Object", + name: "Nested object", + }, + ], + }); +}); + test("compactJsonLdCache() defines no-context prototype-like keys safely", async () => { const original: Record = { "@id": "ap://did:key:z6Mkabc/objects/1", diff --git a/packages/vocab-runtime/src/mod.ts b/packages/vocab-runtime/src/mod.ts index f81321ff6..5208edfde 100644 --- a/packages/vocab-runtime/src/mod.ts +++ b/packages/vocab-runtime/src/mod.ts @@ -50,7 +50,6 @@ export { type PropertyPreprocessorContext, } from "./preprocessor.ts"; export { - canParseIri, expandIPv6Address, formatIri, haveSameIriOrigin, diff --git a/packages/vocab-runtime/src/url.test.ts b/packages/vocab-runtime/src/url.test.ts index 00effa9fb..84c421e9d 100644 --- a/packages/vocab-runtime/src/url.test.ts +++ b/packages/vocab-runtime/src/url.test.ts @@ -1,7 +1,6 @@ import { deepStrictEqual, ok, rejects, throws } from "node:assert"; import { test } from "node:test"; import { - canParseIri, expandIPv6Address, formatIri, haveSameIriOrigin, @@ -22,7 +21,6 @@ test("parseIri() accepts portable ActivityPub URI schemes", () => { "AP+EF61://did:key:z6Mkabc/actor", ]; for (const iri of cases) { - ok(canParseIri(iri)); deepStrictEqual( parseIri(iri), new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), @@ -36,7 +34,6 @@ test("parseIri() accepts DID schemes case-insensitively", () => { "ap://DID%3Akey%3Az6Mkabc/actor", ]; for (const iri of cases) { - ok(canParseIri(iri)); deepStrictEqual( parseIri(iri), new URL("ap+ef61://DID%3Akey%3Az6Mkabc/actor"), @@ -67,7 +64,7 @@ test("parseIri() preserves existing URL parsing behavior", () => { parseIri("at://did:plc:example/record"), new URL("at://did%3Aplc%3Aexample/record"), ); - ok(!canParseIri("ap://not-a-did/actor")); + throws(() => parseIri("ap://not-a-did/actor"), TypeError); }); test("parseJsonLdId() parses JSON-LD ids", () => { @@ -88,7 +85,6 @@ test("parseJsonLdId() parses JSON-LD ids", () => { }); test("parseIri() resolves relative IRIs against portable string bases", () => { - ok(canParseIri("/actor", "ap://did:key:z6Mkabc/objects/1")); deepStrictEqual( parseIri("/actor", "ap://did:key:z6Mkabc/objects/1"), new URL("ap+ef61://did%3Akey%3Az6Mkabc/actor"), @@ -97,7 +93,6 @@ test("parseIri() resolves relative IRIs against portable string bases", () => { parseIri("attachments/1", "ap://did:key:z6Mkabc/objects/1"), new URL("ap+ef61://did%3Akey%3Az6Mkabc/objects/attachments/1"), ); - ok(!canParseIri("//example.com/outbox", "ap://did:key:z6Mkabc/objects/1")); throws( () => parseIri("//example.com/outbox", "ap://did:key:z6Mkabc/objects/1"), TypeError, @@ -105,7 +100,6 @@ test("parseIri() resolves relative IRIs against portable string bases", () => { }); test("parseIri() resolves relative IRIs against at:// string bases", () => { - ok(canParseIri("/record", "at://did:plc:example/collection/item")); deepStrictEqual( parseIri("/record", "at://did:plc:example/collection/item"), new URL("at://did%3Aplc%3Aexample/record"), @@ -121,11 +115,13 @@ test("parseIri() resolves relative IRIs against at:// string bases", () => { }); test("parseIri() rejects portable IRIs without paths", () => { - ok(!canParseIri("ap://did:key:z6Mkabc")); - ok( - !canParseIri("ap://did:key:z6Mkabc?gateways=https%3A%2F%2Fserver.example"), + throws(() => parseIri("ap://did:key:z6Mkabc"), TypeError); + throws( + () => + parseIri("ap://did:key:z6Mkabc?gateways=https%3A%2F%2Fserver.example"), + TypeError, ); - ok(!canParseIri("ap://did:key:z6Mkabc#actor")); + throws(() => parseIri("ap://did:key:z6Mkabc#actor"), TypeError); }); test("parseIri() rejects malformed portable DID authorities", () => { @@ -136,7 +132,6 @@ test("parseIri() rejects malformed portable DID authorities", () => { "ap://did:key:abc%25zz/actor", ]; for (const iri of cases) { - ok(!canParseIri(iri)); throws(() => parseIri(iri), TypeError); } }); @@ -171,7 +166,7 @@ test("parseIri() normalizes portable URL instances", () => { parseIri(new URL("ap+ef61://did%3Aexample%3Aabc%2Fdef/actor")), new URL("ap+ef61://did%3Aexample%3Aabc%252Fdef/actor"), ); - ok(!canParseIri("ap+ef61://not-a-did/actor")); + throws(() => parseIri("ap+ef61://not-a-did/actor"), TypeError); }); test("formatIri() emits canonical portable ActivityPub URI syntax", () => { diff --git a/packages/vocab-runtime/src/url.ts b/packages/vocab-runtime/src/url.ts index 8bd9785ff..4211b67ef 100644 --- a/packages/vocab-runtime/src/url.ts +++ b/packages/vocab-runtime/src/url.ts @@ -15,18 +15,6 @@ const INVALID_PERCENT_ENCODING_PATTERN = /%(?![0-9A-Fa-f]{2})/; const DID_SCHEME_PATTERN = /^did:/i; const DID_PATTERN = /^did:[a-z0-9]+:[-A-Za-z0-9._%]+(?::[-A-Za-z0-9._%]+)*$/i; -/** - * Checks whether the given string can be parsed as an IRI. - */ -export function canParseIri(iri: string, base?: string | URL): boolean { - try { - parseIri(iri, base); - return true; - } catch { - return false; - } -} - /** * Parses a JSON-LD `@id` value as an IRI. */ diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 942fd5ac3..84cb0e008 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -2167,9 +2167,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2179,7 +2180,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2221,7 +2222,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -2416,9 +2417,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2428,7 +2430,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2470,7 +2472,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -2790,9 +2792,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2802,7 +2805,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2844,7 +2847,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3155,9 +3158,10 @@ get contents(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3167,7 +3171,7 @@ get contents(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3209,7 +3213,7 @@ get contents(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3441,9 +3445,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3453,7 +3458,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3495,7 +3500,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3679,9 +3684,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3691,7 +3697,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3733,7 +3739,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4038,9 +4044,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4050,7 +4057,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4092,7 +4099,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4397,9 +4404,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4409,7 +4417,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4451,7 +4459,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4742,9 +4750,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4754,7 +4763,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4796,7 +4805,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5087,9 +5096,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5099,7 +5109,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5141,7 +5151,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5443,9 +5453,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5455,7 +5466,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5497,7 +5508,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5670,9 +5681,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5682,7 +5694,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5724,7 +5736,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5903,9 +5915,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5915,7 +5928,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5957,7 +5970,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6136,9 +6149,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6148,7 +6162,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6190,7 +6204,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6403,9 +6417,10 @@ get summaries(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6415,7 +6430,7 @@ get summaries(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6457,7 +6472,7 @@ get summaries(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6678,9 +6693,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6690,7 +6706,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6732,7 +6748,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7014,9 +7030,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7026,7 +7043,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7068,7 +7085,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7350,9 +7367,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7362,7 +7380,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7404,7 +7422,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7686,9 +7704,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7698,7 +7717,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7740,7 +7759,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8086,9 +8105,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8098,7 +8118,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8140,7 +8160,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8459,9 +8479,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8471,7 +8492,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8513,7 +8534,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8686,9 +8707,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8698,7 +8720,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8740,7 +8762,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8913,9 +8935,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8925,7 +8948,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8967,7 +8990,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -13539,9 +13562,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -13551,7 +13575,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -13593,7 +13617,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -13790,9 +13814,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -13802,7 +13827,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -13844,7 +13869,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15162,9 +15187,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15174,7 +15200,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15216,7 +15242,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15536,9 +15562,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15548,7 +15575,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15590,7 +15617,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15874,9 +15901,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15886,7 +15914,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15928,7 +15956,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16218,9 +16246,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16230,7 +16259,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16272,7 +16301,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16556,9 +16585,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16568,7 +16598,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16610,7 +16640,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16896,9 +16926,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16908,7 +16939,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16950,7 +16981,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -19831,9 +19862,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -19843,7 +19875,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -19885,7 +19917,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -20058,9 +20090,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -20070,7 +20103,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -20112,7 +20145,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -22759,9 +22792,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -22771,7 +22805,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -22813,7 +22847,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -22986,9 +23020,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -22998,7 +23033,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -23040,7 +23075,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -24179,9 +24214,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -24191,7 +24227,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -24233,7 +24269,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -24406,9 +24442,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -24418,7 +24455,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -24460,7 +24497,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -25599,9 +25636,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -25611,7 +25649,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -25653,7 +25691,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -25825,9 +25863,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -25837,7 +25876,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -25879,7 +25918,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -27989,9 +28028,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -28001,7 +28041,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -28043,7 +28083,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -28963,9 +29003,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -28975,7 +29016,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -29017,7 +29058,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -29877,9 +29918,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -29889,7 +29931,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -29931,7 +29973,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -35740,9 +35782,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -35752,7 +35795,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -35794,7 +35837,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36072,9 +36115,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36084,7 +36128,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36126,7 +36170,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36431,9 +36475,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36443,7 +36488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36485,7 +36530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36678,9 +36723,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36690,7 +36736,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36732,7 +36778,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36922,9 +36968,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36934,7 +36981,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36976,7 +37023,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37152,9 +37199,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37164,7 +37212,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37206,7 +37254,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37385,9 +37433,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37397,7 +37446,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37439,7 +37488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37616,9 +37665,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37628,7 +37678,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37670,7 +37720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37845,9 +37895,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37857,7 +37908,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37899,7 +37950,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38074,9 +38125,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38086,7 +38138,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38128,7 +38180,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38378,9 +38430,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38390,7 +38443,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38432,7 +38485,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38639,9 +38692,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38651,7 +38705,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38693,7 +38747,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -39015,9 +39069,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -39027,7 +39082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -39069,7 +39124,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -42451,9 +42506,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -42463,7 +42519,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -42505,7 +42561,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -42702,9 +42758,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -42714,7 +42771,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -42756,7 +42813,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -45658,9 +45715,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -45670,7 +45728,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -45712,7 +45770,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -45885,9 +45943,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -45897,7 +45956,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -45939,7 +45998,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46112,9 +46171,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46124,7 +46184,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46166,7 +46226,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46339,9 +46399,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46351,7 +46412,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46393,7 +46454,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46578,9 +46639,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46590,7 +46652,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46632,7 +46694,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46804,9 +46866,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46816,7 +46879,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46858,7 +46921,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47030,9 +47093,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47042,7 +47106,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47084,7 +47148,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47256,9 +47320,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47268,7 +47333,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47310,7 +47375,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47482,9 +47547,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47494,7 +47560,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47536,7 +47602,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47708,9 +47774,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47720,7 +47787,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47762,7 +47829,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47934,9 +48001,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47946,7 +48014,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47988,7 +48056,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -48160,9 +48228,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -48172,7 +48241,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -48214,7 +48283,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -49959,9 +50028,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -49971,7 +50041,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50013,7 +50083,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -50186,9 +50256,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -50198,7 +50269,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50240,7 +50311,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -50411,9 +50482,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -50423,7 +50495,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50465,7 +50537,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -55420,9 +55492,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -55432,7 +55505,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -55474,7 +55547,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -55752,9 +55825,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -55764,7 +55838,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -55806,7 +55880,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56111,9 +56185,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56123,7 +56198,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56165,7 +56240,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56358,9 +56433,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56370,7 +56446,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56412,7 +56488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56602,9 +56678,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56614,7 +56691,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56656,7 +56733,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56832,9 +56909,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56844,7 +56922,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56886,7 +56964,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57065,9 +57143,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57077,7 +57156,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57119,7 +57198,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57296,9 +57375,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57308,7 +57388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57350,7 +57430,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57525,9 +57605,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57537,7 +57618,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57579,7 +57660,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57754,9 +57835,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57766,7 +57848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57808,7 +57890,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58058,9 +58140,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58070,7 +58153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58112,7 +58195,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58319,9 +58402,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58331,7 +58415,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58373,7 +58457,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58695,9 +58779,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58707,7 +58792,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58749,7 +58834,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -61812,9 +61897,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -61824,7 +61910,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -61866,7 +61952,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -66649,9 +66735,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -66661,7 +66748,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -66703,7 +66790,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -66900,9 +66987,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -66912,7 +67000,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -66954,7 +67042,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -67795,9 +67883,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -67807,7 +67896,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -67849,7 +67938,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -68567,9 +68656,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -68579,7 +68669,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -68621,7 +68711,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70286,9 +70376,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70298,7 +70389,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -70340,7 +70431,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70618,9 +70709,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70630,7 +70722,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -70672,7 +70764,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70977,9 +71069,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70989,7 +71082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71031,7 +71124,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71224,9 +71317,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71236,7 +71330,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71278,7 +71372,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71468,9 +71562,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71480,7 +71575,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71522,7 +71617,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71698,9 +71793,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71710,7 +71806,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71752,7 +71848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71931,9 +72027,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71943,7 +72040,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71985,7 +72082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72162,9 +72259,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72174,7 +72272,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72216,7 +72314,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72391,9 +72489,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72403,7 +72502,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72445,7 +72544,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72620,9 +72719,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72632,7 +72732,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72674,7 +72774,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72924,9 +73024,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72936,7 +73037,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72978,7 +73079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -73185,9 +73286,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -73197,7 +73299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -73239,7 +73341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -73561,9 +73663,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -73573,7 +73676,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -73615,7 +73718,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -77473,9 +77576,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -77485,7 +77589,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -77527,7 +77631,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -77805,9 +77909,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -77817,7 +77922,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -77859,7 +77964,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78164,9 +78269,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78176,7 +78282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78218,7 +78324,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78411,9 +78517,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78423,7 +78530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78465,7 +78572,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78655,9 +78762,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78667,7 +78775,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78709,7 +78817,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78885,9 +78993,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78897,7 +79006,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78939,7 +79048,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79118,9 +79227,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79130,7 +79240,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79172,7 +79282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79349,9 +79459,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79361,7 +79472,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79403,7 +79514,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79578,9 +79689,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79590,7 +79702,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79632,7 +79744,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79807,9 +79919,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79819,7 +79932,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79861,7 +79974,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80111,9 +80224,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80123,7 +80237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80165,7 +80279,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80372,9 +80486,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80384,7 +80499,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80426,7 +80541,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80748,9 +80863,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80760,7 +80876,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80802,7 +80918,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -84452,9 +84568,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -84464,7 +84581,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -84506,7 +84623,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85370,9 +85487,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85382,7 +85500,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85424,7 +85542,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85601,9 +85719,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85613,7 +85732,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85655,7 +85774,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85862,9 +85981,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85874,7 +85994,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85916,7 +86036,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -86113,9 +86233,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -86125,7 +86246,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -86167,7 +86288,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88071,9 +88192,10 @@ relationships?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88083,7 +88205,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88125,7 +88247,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88300,9 +88422,10 @@ relationships?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88312,7 +88435,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88354,7 +88477,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88634,9 +88757,10 @@ relationships?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88646,7 +88770,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88688,7 +88812,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -90894,9 +91018,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -90906,7 +91031,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -90948,7 +91073,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91226,9 +91351,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91238,7 +91364,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91280,7 +91406,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91585,9 +91711,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91597,7 +91724,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91639,7 +91766,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91832,9 +91959,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91844,7 +91972,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91886,7 +92014,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92076,9 +92204,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92088,7 +92217,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92130,7 +92259,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92306,9 +92435,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92318,7 +92448,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92360,7 +92490,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92539,9 +92669,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92551,7 +92682,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92593,7 +92724,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92770,9 +92901,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92782,7 +92914,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92824,7 +92956,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92999,9 +93131,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93011,7 +93144,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93053,7 +93186,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93228,9 +93361,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93240,7 +93374,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93282,7 +93416,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93532,9 +93666,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93544,7 +93679,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93586,7 +93721,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93793,9 +93928,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93805,7 +93941,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93847,7 +93983,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -94169,9 +94305,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -94181,7 +94318,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -94223,7 +94360,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 9aac42fa3..0a26093e6 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -2165,9 +2165,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2177,7 +2178,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2219,7 +2220,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -2414,9 +2415,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2426,7 +2428,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2468,7 +2470,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -2788,9 +2790,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2800,7 +2803,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2842,7 +2845,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3153,9 +3156,10 @@ get contents(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3165,7 +3169,7 @@ get contents(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3207,7 +3211,7 @@ get contents(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3439,9 +3443,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3451,7 +3456,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3493,7 +3498,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3677,9 +3682,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3689,7 +3695,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3731,7 +3737,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4036,9 +4042,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4048,7 +4055,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4090,7 +4097,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4395,9 +4402,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4407,7 +4415,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4449,7 +4457,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4740,9 +4748,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4752,7 +4761,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4794,7 +4803,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5085,9 +5094,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5097,7 +5107,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5139,7 +5149,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5441,9 +5451,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5453,7 +5464,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5495,7 +5506,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5668,9 +5679,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5680,7 +5692,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5722,7 +5734,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5901,9 +5913,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5913,7 +5926,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5955,7 +5968,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6134,9 +6147,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6146,7 +6160,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6188,7 +6202,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6401,9 +6415,10 @@ get summaries(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6413,7 +6428,7 @@ get summaries(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6455,7 +6470,7 @@ get summaries(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6676,9 +6691,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6688,7 +6704,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6730,7 +6746,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7012,9 +7028,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7024,7 +7041,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7066,7 +7083,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7348,9 +7365,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7360,7 +7378,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7402,7 +7420,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7684,9 +7702,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7696,7 +7715,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7738,7 +7757,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8084,9 +8103,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8096,7 +8116,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8138,7 +8158,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8457,9 +8477,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8469,7 +8490,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8511,7 +8532,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8684,9 +8705,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8696,7 +8718,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8738,7 +8760,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8911,9 +8933,10 @@ get urls(): ((URL | Link))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8923,7 +8946,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8965,7 +8988,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -13537,9 +13560,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -13549,7 +13573,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -13591,7 +13615,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -13788,9 +13812,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -13800,7 +13825,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -13842,7 +13867,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15160,9 +15185,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15172,7 +15198,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15214,7 +15240,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15534,9 +15560,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15546,7 +15573,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15588,7 +15615,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15872,9 +15899,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15884,7 +15912,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15926,7 +15954,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16216,9 +16244,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16228,7 +16257,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16270,7 +16299,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16554,9 +16583,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16566,7 +16596,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16608,7 +16638,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16894,9 +16924,10 @@ instruments?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16906,7 +16937,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16948,7 +16979,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -19829,9 +19860,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -19841,7 +19873,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -19883,7 +19915,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -20056,9 +20088,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -20068,7 +20101,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -20110,7 +20143,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -22757,9 +22790,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -22769,7 +22803,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -22811,7 +22845,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -22984,9 +23018,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -22996,7 +23031,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -23038,7 +23073,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -24177,9 +24212,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -24189,7 +24225,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -24231,7 +24267,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -24404,9 +24440,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -24416,7 +24453,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -24458,7 +24495,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -25597,9 +25634,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -25609,7 +25647,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -25651,7 +25689,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -25823,9 +25861,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -25835,7 +25874,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -25877,7 +25916,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -27987,9 +28026,10 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -27999,7 +28039,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -28041,7 +28081,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -28961,9 +29001,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -28973,7 +29014,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -29015,7 +29056,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -29875,9 +29916,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -29887,7 +29929,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -29929,7 +29971,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -35738,9 +35780,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -35750,7 +35793,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -35792,7 +35835,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36070,9 +36113,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36082,7 +36126,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36124,7 +36168,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36429,9 +36473,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36441,7 +36486,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36483,7 +36528,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36676,9 +36721,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36688,7 +36734,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36730,7 +36776,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36920,9 +36966,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36932,7 +36979,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36974,7 +37021,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37150,9 +37197,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37162,7 +37210,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37204,7 +37252,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37383,9 +37431,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37395,7 +37444,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37437,7 +37486,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37614,9 +37663,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37626,7 +37676,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37668,7 +37718,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37843,9 +37893,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37855,7 +37906,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37897,7 +37948,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38072,9 +38123,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38084,7 +38136,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38126,7 +38178,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38376,9 +38428,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38388,7 +38441,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38430,7 +38483,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38637,9 +38690,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38649,7 +38703,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38691,7 +38745,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -39013,9 +39067,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -39025,7 +39080,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -39067,7 +39122,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -42449,9 +42504,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -42461,7 +42517,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -42503,7 +42559,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -42700,9 +42756,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -42712,7 +42769,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -42754,7 +42811,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -45656,9 +45713,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -45668,7 +45726,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -45710,7 +45768,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -45883,9 +45941,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -45895,7 +45954,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -45937,7 +45996,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46110,9 +46169,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46122,7 +46182,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46164,7 +46224,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46337,9 +46397,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46349,7 +46410,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46391,7 +46452,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46576,9 +46637,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46588,7 +46650,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46630,7 +46692,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46802,9 +46864,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46814,7 +46877,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46856,7 +46919,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47028,9 +47091,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47040,7 +47104,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47082,7 +47146,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47254,9 +47318,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47266,7 +47331,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47308,7 +47373,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47480,9 +47545,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47492,7 +47558,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47534,7 +47600,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47706,9 +47772,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47718,7 +47785,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47760,7 +47827,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47932,9 +47999,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47944,7 +48012,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47986,7 +48054,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -48158,9 +48226,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -48170,7 +48239,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -48212,7 +48281,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -49957,9 +50026,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -49969,7 +50039,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50011,7 +50081,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -50184,9 +50254,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -50196,7 +50267,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50238,7 +50309,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -50409,9 +50480,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -50421,7 +50493,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50463,7 +50535,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -55418,9 +55490,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -55430,7 +55503,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -55472,7 +55545,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -55750,9 +55823,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -55762,7 +55836,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -55804,7 +55878,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56109,9 +56183,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56121,7 +56196,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56163,7 +56238,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56356,9 +56431,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56368,7 +56444,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56410,7 +56486,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56600,9 +56676,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56612,7 +56689,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56654,7 +56731,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56830,9 +56907,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56842,7 +56920,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56884,7 +56962,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57063,9 +57141,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57075,7 +57154,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57117,7 +57196,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57294,9 +57373,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57306,7 +57386,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57348,7 +57428,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57523,9 +57603,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57535,7 +57616,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57577,7 +57658,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57752,9 +57833,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57764,7 +57846,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57806,7 +57888,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58056,9 +58138,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58068,7 +58151,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58110,7 +58193,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58317,9 +58400,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58329,7 +58413,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58371,7 +58455,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58693,9 +58777,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58705,7 +58790,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58747,7 +58832,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -61810,9 +61895,10 @@ get names(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -61822,7 +61908,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -61864,7 +61950,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -66647,9 +66733,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -66659,7 +66746,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -66701,7 +66788,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -66898,9 +66985,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -66910,7 +66998,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -66952,7 +67040,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -67793,9 +67881,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -67805,7 +67894,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -67847,7 +67936,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -68565,9 +68654,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -68577,7 +68667,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -68619,7 +68709,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70284,9 +70374,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70296,7 +70387,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -70338,7 +70429,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70616,9 +70707,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70628,7 +70720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -70670,7 +70762,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70975,9 +71067,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70987,7 +71080,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71029,7 +71122,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71222,9 +71315,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71234,7 +71328,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71276,7 +71370,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71466,9 +71560,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71478,7 +71573,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71520,7 +71615,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71696,9 +71791,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71708,7 +71804,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71750,7 +71846,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71929,9 +72025,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71941,7 +72038,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71983,7 +72080,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72160,9 +72257,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72172,7 +72270,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72214,7 +72312,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72389,9 +72487,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72401,7 +72500,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72443,7 +72542,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72618,9 +72717,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72630,7 +72730,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72672,7 +72772,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72922,9 +73022,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72934,7 +73035,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72976,7 +73077,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -73183,9 +73284,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -73195,7 +73297,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -73237,7 +73339,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -73559,9 +73661,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -73571,7 +73674,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -73613,7 +73716,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -77471,9 +77574,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -77483,7 +77587,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -77525,7 +77629,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -77803,9 +77907,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -77815,7 +77920,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -77857,7 +77962,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78162,9 +78267,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78174,7 +78280,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78216,7 +78322,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78409,9 +78515,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78421,7 +78528,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78463,7 +78570,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78653,9 +78760,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78665,7 +78773,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78707,7 +78815,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78883,9 +78991,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78895,7 +79004,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78937,7 +79046,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79116,9 +79225,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79128,7 +79238,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79170,7 +79280,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79347,9 +79457,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79359,7 +79470,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79401,7 +79512,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79576,9 +79687,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79588,7 +79700,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79630,7 +79742,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79805,9 +79917,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79817,7 +79930,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79859,7 +79972,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80109,9 +80222,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80121,7 +80235,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80163,7 +80277,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80370,9 +80484,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80382,7 +80497,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80424,7 +80539,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80746,9 +80861,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80758,7 +80874,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80800,7 +80916,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -84450,9 +84566,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -84462,7 +84579,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -84504,7 +84621,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85368,9 +85485,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85380,7 +85498,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85422,7 +85540,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85599,9 +85717,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85611,7 +85730,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85653,7 +85772,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85860,9 +85979,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85872,7 +85992,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85914,7 +86034,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -86111,9 +86231,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -86123,7 +86244,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -86165,7 +86286,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88069,9 +88190,10 @@ relationships?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88081,7 +88203,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88123,7 +88245,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88298,9 +88420,10 @@ relationships?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88310,7 +88433,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88352,7 +88475,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88632,9 +88755,10 @@ relationships?: (Object | URL)[];} \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88644,7 +88768,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88686,7 +88810,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -90892,9 +91016,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -90904,7 +91029,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -90946,7 +91071,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91224,9 +91349,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91236,7 +91362,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91278,7 +91404,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91583,9 +91709,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91595,7 +91722,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91637,7 +91764,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91830,9 +91957,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91842,7 +91970,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91884,7 +92012,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92074,9 +92202,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92086,7 +92215,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92128,7 +92257,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92304,9 +92433,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92316,7 +92446,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92358,7 +92488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92537,9 +92667,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92549,7 +92680,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92591,7 +92722,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92768,9 +92899,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92780,7 +92912,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92822,7 +92954,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92997,9 +93129,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93009,7 +93142,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93051,7 +93184,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93226,9 +93359,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93238,7 +93372,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93280,7 +93414,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93530,9 +93664,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93542,7 +93677,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93584,7 +93719,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93791,9 +93926,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93803,7 +93939,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93845,7 +93981,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -94167,9 +94303,10 @@ get preferredUsernames(): ((string | LanguageString))[] { \\"0.0.0\\", ); return await tracer.startActiveSpan(\\"activitypub.lookup_object\\", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -94179,7 +94316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to fetch {url}: {error}\\", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -94221,7 +94358,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger([\\"fedify\\", \\"vocab\\"]).error( \\"Failed to parse {url}: {error}\\", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index 5a57ae361..dea573c4c 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -2167,9 +2167,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2179,7 +2180,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2221,7 +2222,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -2416,9 +2417,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2428,7 +2430,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2470,7 +2472,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -2790,9 +2792,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -2802,7 +2805,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -2844,7 +2847,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3155,9 +3158,10 @@ get contents(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3167,7 +3171,7 @@ get contents(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3209,7 +3213,7 @@ get contents(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3441,9 +3445,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3453,7 +3458,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3495,7 +3500,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -3679,9 +3684,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -3691,7 +3697,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -3733,7 +3739,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4038,9 +4044,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4050,7 +4057,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4092,7 +4099,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4397,9 +4404,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4409,7 +4417,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4451,7 +4459,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -4742,9 +4750,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -4754,7 +4763,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -4796,7 +4805,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5087,9 +5096,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5099,7 +5109,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5141,7 +5151,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5443,9 +5453,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5455,7 +5466,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5497,7 +5508,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5670,9 +5681,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5682,7 +5694,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5724,7 +5736,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -5903,9 +5915,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -5915,7 +5928,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -5957,7 +5970,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6136,9 +6149,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6148,7 +6162,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6190,7 +6204,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6403,9 +6417,10 @@ get summaries(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6415,7 +6430,7 @@ get summaries(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6457,7 +6472,7 @@ get summaries(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -6678,9 +6693,10 @@ get urls(): ((URL | Link))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -6690,7 +6706,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -6732,7 +6748,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7014,9 +7030,10 @@ get urls(): ((URL | Link))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7026,7 +7043,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7068,7 +7085,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7350,9 +7367,10 @@ get urls(): ((URL | Link))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7362,7 +7380,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7404,7 +7422,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -7686,9 +7704,10 @@ get urls(): ((URL | Link))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -7698,7 +7717,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -7740,7 +7759,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8086,9 +8105,10 @@ get urls(): ((URL | Link))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8098,7 +8118,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8140,7 +8160,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8459,9 +8479,10 @@ get urls(): ((URL | Link))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8471,7 +8492,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8513,7 +8534,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8686,9 +8707,10 @@ get urls(): ((URL | Link))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8698,7 +8720,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8740,7 +8762,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -8913,9 +8935,10 @@ get urls(): ((URL | Link))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -8925,7 +8948,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -8967,7 +8990,7 @@ get urls(): ((URL | Link))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -13539,9 +13562,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -13551,7 +13575,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -13593,7 +13617,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -13790,9 +13814,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -13802,7 +13827,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -13844,7 +13869,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15162,9 +15187,10 @@ instruments?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15174,7 +15200,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15216,7 +15242,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15536,9 +15562,10 @@ instruments?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15548,7 +15575,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15590,7 +15617,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -15874,9 +15901,10 @@ instruments?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -15886,7 +15914,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -15928,7 +15956,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16218,9 +16246,10 @@ instruments?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16230,7 +16259,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16272,7 +16301,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16556,9 +16585,10 @@ instruments?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16568,7 +16598,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16610,7 +16640,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -16896,9 +16926,10 @@ instruments?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -16908,7 +16939,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -16950,7 +16981,7 @@ instruments?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -19831,9 +19862,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -19843,7 +19875,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -19885,7 +19917,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -20058,9 +20090,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -20070,7 +20103,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -20112,7 +20145,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -22759,9 +22792,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -22771,7 +22805,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -22813,7 +22847,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -22986,9 +23020,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -22998,7 +23033,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -23040,7 +23075,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -24179,9 +24214,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -24191,7 +24227,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -24233,7 +24269,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -24406,9 +24442,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -24418,7 +24455,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -24460,7 +24497,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -25599,9 +25636,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -25611,7 +25649,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -25653,7 +25691,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -25825,9 +25863,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -25837,7 +25876,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -25879,7 +25918,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -27989,9 +28028,10 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -28001,7 +28041,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -28043,7 +28083,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -28963,9 +29003,10 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -28975,7 +29016,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -29017,7 +29058,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -29877,9 +29918,10 @@ controller?: Application | Group | Organization | Person | Service | URL | null; "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -29889,7 +29931,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -29931,7 +29973,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -35740,9 +35782,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -35752,7 +35795,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -35794,7 +35837,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36072,9 +36115,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36084,7 +36128,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36126,7 +36170,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36431,9 +36475,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36443,7 +36488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36485,7 +36530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36678,9 +36723,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36690,7 +36736,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36732,7 +36778,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -36922,9 +36968,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -36934,7 +36981,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -36976,7 +37023,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37152,9 +37199,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37164,7 +37212,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37206,7 +37254,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37385,9 +37433,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37397,7 +37446,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37439,7 +37488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37616,9 +37665,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37628,7 +37678,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37670,7 +37720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -37845,9 +37895,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -37857,7 +37908,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -37899,7 +37950,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38074,9 +38125,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38086,7 +38138,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38128,7 +38180,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38378,9 +38430,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38390,7 +38443,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38432,7 +38485,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -38639,9 +38692,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -38651,7 +38705,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -38693,7 +38747,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -39015,9 +39069,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -39027,7 +39082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -39069,7 +39124,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -42451,9 +42506,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -42463,7 +42519,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -42505,7 +42561,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -42702,9 +42758,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -42714,7 +42771,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -42756,7 +42813,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -45658,9 +45715,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -45670,7 +45728,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -45712,7 +45770,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -45885,9 +45943,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -45897,7 +45956,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -45939,7 +45998,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46112,9 +46171,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46124,7 +46184,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46166,7 +46226,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46339,9 +46399,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46351,7 +46412,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46393,7 +46454,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46578,9 +46639,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46590,7 +46652,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46632,7 +46694,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -46804,9 +46866,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -46816,7 +46879,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -46858,7 +46921,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47030,9 +47093,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47042,7 +47106,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47084,7 +47148,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47256,9 +47320,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47268,7 +47333,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47310,7 +47375,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47482,9 +47547,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47494,7 +47560,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47536,7 +47602,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47708,9 +47774,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47720,7 +47787,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47762,7 +47829,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -47934,9 +48001,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -47946,7 +48014,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -47988,7 +48056,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -48160,9 +48228,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -48172,7 +48241,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -48214,7 +48283,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -49959,9 +50028,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -49971,7 +50041,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50013,7 +50083,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -50186,9 +50256,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -50198,7 +50269,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50240,7 +50311,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -50411,9 +50482,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -50423,7 +50495,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -50465,7 +50537,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -55420,9 +55492,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -55432,7 +55505,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -55474,7 +55547,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -55752,9 +55825,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -55764,7 +55838,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -55806,7 +55880,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56111,9 +56185,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56123,7 +56198,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56165,7 +56240,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56358,9 +56433,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56370,7 +56446,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56412,7 +56488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56602,9 +56678,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56614,7 +56691,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56656,7 +56733,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -56832,9 +56909,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -56844,7 +56922,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -56886,7 +56964,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57065,9 +57143,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57077,7 +57156,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57119,7 +57198,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57296,9 +57375,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57308,7 +57388,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57350,7 +57430,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57525,9 +57605,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57537,7 +57618,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57579,7 +57660,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -57754,9 +57835,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -57766,7 +57848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -57808,7 +57890,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58058,9 +58140,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58070,7 +58153,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58112,7 +58195,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58319,9 +58402,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58331,7 +58415,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58373,7 +58457,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -58695,9 +58779,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -58707,7 +58792,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -58749,7 +58834,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -61812,9 +61897,10 @@ get names(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -61824,7 +61910,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -61866,7 +61952,7 @@ get names(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -66649,9 +66735,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -66661,7 +66748,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -66703,7 +66790,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -66900,9 +66987,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -66912,7 +67000,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -66954,7 +67042,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -67795,9 +67883,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -67807,7 +67896,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -67849,7 +67938,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -68567,9 +68656,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -68579,7 +68669,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -68621,7 +68711,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70286,9 +70376,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70298,7 +70389,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -70340,7 +70431,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70618,9 +70709,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70630,7 +70722,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -70672,7 +70764,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -70977,9 +71069,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -70989,7 +71082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71031,7 +71124,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71224,9 +71317,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71236,7 +71330,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71278,7 +71372,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71468,9 +71562,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71480,7 +71575,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71522,7 +71617,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71698,9 +71793,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71710,7 +71806,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71752,7 +71848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -71931,9 +72027,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -71943,7 +72040,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -71985,7 +72082,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72162,9 +72259,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72174,7 +72272,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72216,7 +72314,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72391,9 +72489,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72403,7 +72502,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72445,7 +72544,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72620,9 +72719,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72632,7 +72732,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72674,7 +72774,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -72924,9 +73024,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -72936,7 +73037,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -72978,7 +73079,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -73185,9 +73286,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -73197,7 +73299,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -73239,7 +73341,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -73561,9 +73663,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -73573,7 +73676,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -73615,7 +73718,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -77473,9 +77576,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -77485,7 +77589,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -77527,7 +77631,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -77805,9 +77909,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -77817,7 +77922,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -77859,7 +77964,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78164,9 +78269,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78176,7 +78282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78218,7 +78324,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78411,9 +78517,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78423,7 +78530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78465,7 +78572,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78655,9 +78762,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78667,7 +78775,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78709,7 +78817,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -78885,9 +78993,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -78897,7 +79006,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -78939,7 +79048,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79118,9 +79227,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79130,7 +79240,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79172,7 +79282,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79349,9 +79459,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79361,7 +79472,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79403,7 +79514,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79578,9 +79689,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79590,7 +79702,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79632,7 +79744,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -79807,9 +79919,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -79819,7 +79932,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -79861,7 +79974,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80111,9 +80224,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80123,7 +80237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80165,7 +80279,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80372,9 +80486,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80384,7 +80499,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80426,7 +80541,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -80748,9 +80863,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -80760,7 +80876,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -80802,7 +80918,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -84452,9 +84568,10 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -84464,7 +84581,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -84506,7 +84623,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85370,9 +85487,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85382,7 +85500,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85424,7 +85542,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85601,9 +85719,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85613,7 +85732,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85655,7 +85774,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -85862,9 +85981,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -85874,7 +85994,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -85916,7 +86036,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -86113,9 +86233,10 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -86125,7 +86246,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -86167,7 +86288,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88071,9 +88192,10 @@ relationships?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88083,7 +88205,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88125,7 +88247,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88300,9 +88422,10 @@ relationships?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88312,7 +88435,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88354,7 +88477,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -88634,9 +88757,10 @@ relationships?: (Object | URL)[];} "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -88646,7 +88770,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -88688,7 +88812,7 @@ relationships?: (Object | URL)[];} if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -90894,9 +91018,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -90906,7 +91031,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -90948,7 +91073,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91226,9 +91351,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91238,7 +91364,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91280,7 +91406,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91585,9 +91711,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91597,7 +91724,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91639,7 +91766,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -91832,9 +91959,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -91844,7 +91972,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -91886,7 +92014,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92076,9 +92204,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92088,7 +92217,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92130,7 +92259,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92306,9 +92435,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92318,7 +92448,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92360,7 +92490,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92539,9 +92669,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92551,7 +92682,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92593,7 +92724,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92770,9 +92901,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -92782,7 +92914,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -92824,7 +92956,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -92999,9 +93131,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93011,7 +93144,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93053,7 +93186,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93228,9 +93361,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93240,7 +93374,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93282,7 +93416,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93532,9 +93666,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93544,7 +93679,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93586,7 +93721,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -93793,9 +93928,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -93805,7 +93941,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -93847,7 +93983,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } @@ -94169,9 +94305,10 @@ get preferredUsernames(): ((string | LanguageString))[] { "0.0.0", ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -94181,7 +94318,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -94223,7 +94360,7 @@ get preferredUsernames(): ((string | LanguageString))[] { if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index fb4e01802..faa1e20c5 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -86,9 +86,10 @@ async function* generateProperty( ${JSON.stringify(metadata.version)}, ); return await tracer.startActiveSpan("activitypub.lookup_object", async (span) => { + const lookupUrl = formatIri(url); let fetchResult: RemoteDocument; try { - fetchResult = await documentLoader(url.href); + fetchResult = await documentLoader(lookupUrl); } catch (error) { span.setStatus({ code: SpanStatusCode.ERROR, @@ -98,7 +99,7 @@ async function* generateProperty( if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to fetch {url}: {error}", - { error, url: url.href } + { error, url: lookupUrl } ); return null; } @@ -140,7 +141,7 @@ async function* generateProperty( if (options.suppressError) { getLogger(["fedify", "vocab"]).error( "Failed to parse {url}: {error}", - { error: e, url: url.href } + { error: e, url: lookupUrl } ); return null; } diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index fb1466cae..831ba8845 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -1506,6 +1506,37 @@ test({ }, }); +test("Activity.getObject() fetches canonical portable IRIs", async () => { + const fetchedUrls: string[] = []; + // deno-lint-ignore require-await + const documentLoader: DocumentLoader = async (url) => { + fetchedUrls.push(url); + return { + contextUrl: null, + documentUrl: url, + document: { + "@context": "https://www.w3.org/ns/activitystreams", + id: url, + type: "Note", + content: "Fetched portable object", + }, + }; + }; + const activity = await Activity.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + type: "Create", + object: "ap://did:key:z6Mkabc/objects/1", + }, { documentLoader, contextLoader: mockDocumentLoader }); + + const object = await activity.getObject({ + documentLoader, + contextLoader: mockDocumentLoader, + }); + + assertInstanceOf(object, Note); + deepStrictEqual(fetchedUrls, ["ap+ef61://did:key:z6Mkabc/objects/1"]); +}); + test({ name: "Activity.getObjects()", permissions: { env: true, read: true }, @@ -3588,7 +3619,7 @@ test( // deno-lint-ignore require-await const documentLoader = async (url: string) => { - if (url === "ap+ef61://did%3Akey%3Az6MkOther/note") { + if (url === "ap+ef61://did:key:z6MkOther/note") { return { documentUrl: url, contextUrl: null, From a8eea748c853847d67f8daca4457f8e455d14a5c Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 3 Jul 2026 01:37:41 +0900 Subject: [PATCH 52/55] Avoid needless cache merge cloning Return the compacted JSON-LD object directly when there are no unmapped terms to merge, preserving object identity for unchanged cache subtrees. https://github.com/fedify-dev/fedify/pull/850#discussion_r3514484548 Assisted-by: Codex:gpt-5.5 --- packages/vocab-runtime/src/internal/jsonld-cache.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index dc2b2e42b..a9f8d3ba0 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -337,12 +337,12 @@ async function mergeUnmappedTerms( ) { return compacted; } - const result = { ...compacted as Record }; const unmappedKeys = globalThis.Object.keys(original).filter((key) => key !== "@context" && - !globalThis.Object.prototype.hasOwnProperty.call(result, key) + !globalThis.Object.prototype.hasOwnProperty.call(compacted, key) ); - if (unmappedKeys.length < 1) return result; + if (unmappedKeys.length < 1) return compacted; + const result = { ...compacted as Record }; const compactedWithContext = compacted != null && typeof compacted === "object" && !Array.isArray(compacted) && !("@context" in compacted) From e22d8dd060cf27b54ad408677d33bec9b2cfc2c2 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 3 Jul 2026 01:50:47 +0900 Subject: [PATCH 53/55] Flatten merged JSON-LD contexts Nested objects can provide their own context as an array. When that context is merged with an inherited context, keep the resulting JSON-LD context flat so processors do not see an invalid nested array. https://github.com/fedify-dev/fedify/pull/850#discussion_r3514721867 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 8 ++-- .../vocab-runtime/src/jsonld-cache.test.ts | 41 +++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index a9f8d3ba0..ad1e2357a 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -504,7 +504,9 @@ function combineContexts( if (ownContext == null || ownContext === inheritedContext) { return inheritedContext; } - return Array.isArray(inheritedContext) - ? [...inheritedContext, ownContext] - : [inheritedContext, ownContext]; + const inherited = Array.isArray(inheritedContext) + ? inheritedContext + : [inheritedContext]; + const own = Array.isArray(ownContext) ? ownContext : [ownContext]; + return [...inherited, ...own]; } diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index cce1e1d89..9bde0476e 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -394,6 +394,47 @@ test("compactJsonLdCache() preserves nested contexts", async () => { }); }); +test("compactJsonLdCache() preserves nested array contexts", async () => { + const context = { + as: "https://www.w3.org/ns/activitystreams#", + id: "@id", + type: "@type", + attachment: { "@id": "as:attachment" }, + }; + const nestedContext = [ + { + id: "@id", + type: "@type", + }, + { + title: "https://example.com/ns#title", + }, + ]; + const original = { + "@context": context, + type: "as:Note", + id: "ap://did:key:z6Mkabc/objects/1", + attachment: { + "@context": nestedContext, + type: "as:Object", + title: "Nested title.", + }, + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + + deepStrictEqual(await compactJsonLdCache(normalized, original), { + "@context": context, + type: "as:Note", + id: "ap+ef61://did:key:z6Mkabc/objects/1", + attachment: { + "@context": nestedContext, + type: "as:Object", + "https://example.com/ns#title": "Nested title.", + }, + }); +}); + test("compactJsonLdCache() does not re-add represented nested aliases", async () => { const context = { as: "https://www.w3.org/ns/activitystreams#", From b291ae9ffd31f0fdcc72a6950dcb2d2b57940ec2 Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 3 Jul 2026 02:04:48 +0900 Subject: [PATCH 54/55] Honor id-less cross-origin trust Generated getters should still respect crossOrigin: "trust" when the owning object has no id. Without that, id-less parsed objects replaced embedded property objects with their ids and fetched unnecessarily. https://github.com/fedify-dev/fedify/pull/850#discussion_r3514814157 Assisted-by: Codex:gpt-5.5 --- .../src/__snapshots__/class.test.ts.deno.snap | 409 ++++++++---------- .../src/__snapshots__/class.test.ts.node.snap | 409 ++++++++---------- .../src/__snapshots__/class.test.ts.snap | 409 ++++++++---------- packages/vocab-tools/src/property.ts | 5 +- packages/vocab/src/vocab.test.ts | 63 +++ 5 files changed, 596 insertions(+), 699 deletions(-) diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap index 84cb0e008..054901727 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap @@ -2329,8 +2329,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2597,7 +2596,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2704,8 +2703,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -2935,7 +2933,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3041,8 +3039,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3315,8 +3312,7 @@ get contents(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3596,8 +3592,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3849,7 +3844,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -3956,8 +3951,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4209,7 +4203,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4316,8 +4310,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4556,7 +4549,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4662,8 +4655,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4902,7 +4894,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5008,8 +5000,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5247,7 +5238,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5352,8 +5343,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5596,7 +5586,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5830,7 +5820,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6064,7 +6054,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6292,7 +6282,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6571,8 +6561,7 @@ get summaries(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6836,7 +6825,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -6942,8 +6931,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7173,7 +7161,7 @@ get urls(): ((URL | Link))[] { let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7279,8 +7267,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7510,7 +7497,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7616,8 +7603,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7847,7 +7833,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -7953,8 +7939,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8247,7 +8232,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8352,8 +8337,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8622,7 +8606,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8850,7 +8834,7 @@ get urls(): ((URL | Link))[] { let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9078,7 +9062,7 @@ get urls(): ((URL | Link))[] { let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -13706,7 +13690,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -13957,7 +13941,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -15367,7 +15351,7 @@ instruments?: (Object | URL)[];} let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15474,8 +15458,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15706,7 +15689,7 @@ instruments?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -15813,8 +15796,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16048,7 +16030,7 @@ instruments?: (Object | URL)[];} let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16158,8 +16140,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16390,7 +16371,7 @@ instruments?: (Object | URL)[];} let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16497,8 +16478,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16730,7 +16710,7 @@ instruments?: (Object | URL)[];} let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -16838,8 +16818,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17069,7 +17048,7 @@ instruments?: (Object | URL)[];} let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17175,8 +17154,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -20005,7 +19983,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20232,7 +20210,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -22935,7 +22913,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23162,7 +23140,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24357,7 +24335,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24584,7 +24562,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -25778,7 +25756,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26005,7 +25983,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -28173,7 +28151,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -29180,7 +29158,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -30095,7 +30073,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -35923,7 +35901,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36027,8 +36005,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36260,7 +36237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36368,8 +36345,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36638,7 +36614,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36883,7 +36859,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37114,7 +37090,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37348,7 +37324,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37580,7 +37556,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37810,7 +37786,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38040,7 +38016,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38267,8 +38243,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38607,7 +38582,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38873,7 +38848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -38981,8 +38956,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39214,7 +39188,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39322,8 +39296,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -42650,7 +42623,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42901,7 +42874,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -45858,7 +45831,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46086,7 +46059,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46314,7 +46287,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46551,8 +46524,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46781,7 +46753,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -47008,7 +46980,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47235,7 +47207,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47462,7 +47434,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47689,7 +47661,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47916,7 +47888,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48143,7 +48115,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48370,7 +48342,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -50171,7 +50143,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50397,7 +50369,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50624,7 +50596,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -55633,7 +55605,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55737,8 +55709,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55970,7 +55941,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56078,8 +56049,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56348,7 +56318,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56593,7 +56563,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56824,7 +56794,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -57058,7 +57028,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57290,7 +57260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57520,7 +57490,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57750,7 +57720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57977,8 +57947,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58317,7 +58286,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58583,7 +58552,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58691,8 +58660,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58924,7 +58892,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59032,8 +59000,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -62047,8 +62014,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -66879,7 +66845,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67130,7 +67096,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -68035,8 +68001,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68808,8 +68773,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -70517,7 +70481,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70621,8 +70585,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70854,7 +70817,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70962,8 +70925,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71232,7 +71194,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71477,7 +71439,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71708,7 +71670,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71942,7 +71904,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72174,7 +72136,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72404,7 +72366,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72634,7 +72596,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72861,8 +72823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -73201,7 +73162,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73467,7 +73428,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73575,8 +73536,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73808,7 +73768,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73916,8 +73876,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -77717,7 +77676,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77821,8 +77780,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -78054,7 +78012,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78162,8 +78120,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78432,7 +78389,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78677,7 +78634,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78908,7 +78865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79142,7 +79099,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79374,7 +79331,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79604,7 +79561,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79834,7 +79791,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -80061,8 +80018,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80401,7 +80357,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80667,7 +80623,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80775,8 +80731,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -81008,7 +80963,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81116,8 +81071,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -84711,7 +84665,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -85631,8 +85585,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85863,8 +85816,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -86125,7 +86077,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86376,7 +86328,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -88337,7 +88289,7 @@ relationships?: (Object | URL)[];} let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88564,7 +88516,7 @@ relationships?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88669,8 +88621,7 @@ relationships?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88901,7 +88852,7 @@ relationships?: (Object | URL)[];} let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -89008,8 +88959,7 @@ relationships?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -91159,7 +91109,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91263,8 +91213,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91496,7 +91445,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91604,8 +91553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91874,7 +91822,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -92119,7 +92067,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92350,7 +92298,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92584,7 +92532,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92816,7 +92764,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -93046,7 +92994,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93276,7 +93224,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93503,8 +93451,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93843,7 +93790,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -94109,7 +94056,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94217,8 +94164,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94450,7 +94396,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94558,8 +94504,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap index 0a26093e6..9c459b572 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap @@ -2327,8 +2327,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2595,7 +2594,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2702,8 +2701,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -2933,7 +2931,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3039,8 +3037,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3313,8 +3310,7 @@ get contents(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3594,8 +3590,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3847,7 +3842,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -3954,8 +3949,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4207,7 +4201,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4314,8 +4308,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4554,7 +4547,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4660,8 +4653,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4900,7 +4892,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5006,8 +4998,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5245,7 +5236,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5350,8 +5341,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5594,7 +5584,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5828,7 +5818,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6062,7 +6052,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6290,7 +6280,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6569,8 +6559,7 @@ get summaries(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6834,7 +6823,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -6940,8 +6929,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7171,7 +7159,7 @@ get urls(): ((URL | Link))[] { let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7277,8 +7265,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7508,7 +7495,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7614,8 +7601,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7845,7 +7831,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -7951,8 +7937,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8245,7 +8230,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8350,8 +8335,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8620,7 +8604,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8848,7 +8832,7 @@ get urls(): ((URL | Link))[] { let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9076,7 +9060,7 @@ get urls(): ((URL | Link))[] { let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -13704,7 +13688,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -13955,7 +13939,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -15365,7 +15349,7 @@ instruments?: (Object | URL)[];} let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15472,8 +15456,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15704,7 +15687,7 @@ instruments?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -15811,8 +15794,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16046,7 +16028,7 @@ instruments?: (Object | URL)[];} let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16156,8 +16138,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16388,7 +16369,7 @@ instruments?: (Object | URL)[];} let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16495,8 +16476,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16728,7 +16708,7 @@ instruments?: (Object | URL)[];} let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -16836,8 +16816,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17067,7 +17046,7 @@ instruments?: (Object | URL)[];} let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17173,8 +17152,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -20003,7 +19981,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20230,7 +20208,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -22933,7 +22911,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23160,7 +23138,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24355,7 +24333,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24582,7 +24560,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -25776,7 +25754,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26003,7 +25981,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -28171,7 +28149,7 @@ cryptosuite?: \\"eddsa-jcs-2022\\" | null;verificationMethod?: Multikey | URL | let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -29178,7 +29156,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -30093,7 +30071,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -35921,7 +35899,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36025,8 +36003,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36258,7 +36235,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36366,8 +36343,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36636,7 +36612,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36881,7 +36857,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37112,7 +37088,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37346,7 +37322,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37578,7 +37554,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37808,7 +37784,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38038,7 +38014,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38265,8 +38241,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38605,7 +38580,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38871,7 +38846,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -38979,8 +38954,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39212,7 +39186,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39320,8 +39294,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -42648,7 +42621,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42899,7 +42872,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -45856,7 +45829,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46084,7 +46057,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46312,7 +46285,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46549,8 +46522,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46779,7 +46751,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -47006,7 +46978,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47233,7 +47205,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47460,7 +47432,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47687,7 +47659,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47914,7 +47886,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48141,7 +48113,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48368,7 +48340,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -50169,7 +50141,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50395,7 +50367,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50622,7 +50594,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -55631,7 +55603,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55735,8 +55707,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55968,7 +55939,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56076,8 +56047,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56346,7 +56316,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56591,7 +56561,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56822,7 +56792,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -57056,7 +57026,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57288,7 +57258,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57518,7 +57488,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57748,7 +57718,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57975,8 +57945,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58315,7 +58284,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58581,7 +58550,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58689,8 +58658,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58922,7 +58890,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59030,8 +58998,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -62045,8 +62012,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -66877,7 +66843,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67128,7 +67094,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -68033,8 +67999,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68806,8 +68771,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -70515,7 +70479,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70619,8 +70583,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70852,7 +70815,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70960,8 +70923,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71230,7 +71192,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71475,7 +71437,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71706,7 +71668,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71940,7 +71902,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72172,7 +72134,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72402,7 +72364,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72632,7 +72594,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72859,8 +72821,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -73199,7 +73160,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73465,7 +73426,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73573,8 +73534,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73806,7 +73766,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73914,8 +73874,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -77715,7 +77674,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77819,8 +77778,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -78052,7 +78010,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78160,8 +78118,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78430,7 +78387,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78675,7 +78632,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78906,7 +78863,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79140,7 +79097,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79372,7 +79329,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79602,7 +79559,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79832,7 +79789,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -80059,8 +80016,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80399,7 +80355,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80665,7 +80621,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80773,8 +80729,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -81006,7 +80961,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81114,8 +81069,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -84709,7 +84663,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -85629,8 +85583,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85861,8 +85814,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -86123,7 +86075,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86374,7 +86326,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -88335,7 +88287,7 @@ relationships?: (Object | URL)[];} let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88562,7 +88514,7 @@ relationships?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88667,8 +88619,7 @@ relationships?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88899,7 +88850,7 @@ relationships?: (Object | URL)[];} let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -89006,8 +88957,7 @@ relationships?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -91157,7 +91107,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91261,8 +91211,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91494,7 +91443,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91602,8 +91551,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91872,7 +91820,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -92117,7 +92065,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92348,7 +92296,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92582,7 +92530,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92814,7 +92762,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -93044,7 +92992,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93274,7 +93222,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93501,8 +93449,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93841,7 +93788,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -94107,7 +94054,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94215,8 +94162,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94448,7 +94394,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94556,8 +94502,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } diff --git a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap index dea573c4c..5ba9091e0 100644 --- a/packages/vocab-tools/src/__snapshots__/class.test.ts.snap +++ b/packages/vocab-tools/src/__snapshots__/class.test.ts.snap @@ -2329,8 +2329,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_49BipA5dq9eoH8LX8xdsVumveTca_attachment.has(i)) { v = v.id; } @@ -2597,7 +2596,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(0)) { v = v.id; } @@ -2704,8 +2703,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42CGqJ94zgQ3ZBbfHwD8Hrr2L5Py_attributedTo.has(i)) { v = v.id; } @@ -2935,7 +2933,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(0)) { v = v.id; } @@ -3041,8 +3039,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ocC3VVi88cEd5sPWL8djkZsvTN6_audience.has(i)) { v = v.id; } @@ -3315,8 +3312,7 @@ get contents(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3mhZzGXSpQ431mBSz2kvych22v4e_context.has(i)) { v = v.id; } @@ -3596,8 +3592,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_86xFhmgBapoMvYqjbjRuDPayTrS_generator.has(i)) { v = v.id; } @@ -3849,7 +3844,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(0)) { v = v.id; } @@ -3956,8 +3951,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_33CjRLy5ujtsUrwRSCrsggvGdKuR_icon.has(i)) { v = v.id; } @@ -4209,7 +4203,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3dXrUdkARxwyJLtJcYi1AJ92H41U_image[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(0)) { v = v.id; } @@ -4316,8 +4310,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3dXrUdkARxwyJLtJcYi1AJ92H41U_image.has(i)) { v = v.id; } @@ -4556,7 +4549,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(0)) { v = v.id; } @@ -4662,8 +4655,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fpbDrvZgf3Kq1a5V9aByFn8kx3s_inReplyTo.has(i)) { v = v.id; } @@ -4902,7 +4894,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_31k5MUZJsnsPNg8dQQJieWaXTFnR_location[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(0)) { v = v.id; } @@ -5008,8 +5000,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_31k5MUZJsnsPNg8dQQJieWaXTFnR_location.has(i)) { v = v.id; } @@ -5247,7 +5238,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_gCVTegXxWWCw6wWRxa1QF65zusg_preview[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(0)) { v = v.id; } @@ -5352,8 +5343,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -5596,7 +5586,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_7UpwM3JWcXhADcscukEehBorf6k_replies[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_7UpwM3JWcXhADcscukEehBorf6k_replies.has(0)) { v = v.id; } @@ -5830,7 +5820,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_3kAfck9PcEYt2L7xug5y99YPbANs_shares[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3kAfck9PcEYt2L7xug5y99YPbANs_shares.has(0)) { v = v.id; } @@ -6064,7 +6054,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_S3ceDnpMdzoTRCccB9FkJWrEzYW_likes.has(0)) { v = v.id; } @@ -6292,7 +6282,7 @@ get names(): ((string | LanguageString))[] { let v = this.#_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_kMatyyNAuxoTD8GQMBfA5ogThMR_emojiReactions.has(0)) { v = v.id; } @@ -6571,8 +6561,7 @@ get summaries(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5chuqj6s95p5gg2sk1HntGfarRf_tag.has(i)) { v = v.id; } @@ -6836,7 +6825,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(0)) { v = v.id; } @@ -6942,8 +6931,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3hFbw7DTpHhq3cvVhkY8njhcsXbd_to.has(i)) { v = v.id; } @@ -7173,7 +7161,7 @@ get urls(): ((URL | Link))[] { let v = this.#_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(0)) { v = v.id; } @@ -7279,8 +7267,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_aLZupjwL8XB7tzdLgCMXdjZ6qej_bto.has(i)) { v = v.id; } @@ -7510,7 +7497,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(0)) { v = v.id; } @@ -7616,8 +7603,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42a1SvBs24QSLzKcfjCyNTjW5a1g_cc.has(i)) { v = v.id; } @@ -7847,7 +7833,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(0)) { v = v.id; } @@ -7953,8 +7939,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3qvegKUB8YLgTXRpEf8E6JZSkz2H_bcc.has(i)) { v = v.id; } @@ -8247,7 +8232,7 @@ get urls(): ((URL | Link))[] { let v = this.#_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(0)) { v = v.id; } @@ -8352,8 +8337,7 @@ get urls(): ((URL | Link))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_42rPnotok1ivQ2RNCKNbeFJgx8b8_proof.has(i)) { v = v.id; } @@ -8622,7 +8606,7 @@ get urls(): ((URL | Link))[] { let v = this.#_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3fCeb5aXaDDd4fvkQ96BLWifBUBa_likeAuthorization.has(0)) { v = v.id; } @@ -8850,7 +8834,7 @@ get urls(): ((URL | Link))[] { let v = this.#_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_YA4wdUW7rYztAQ6SjhMnJCmcmtP_replyAuthorization.has(0)) { v = v.id; } @@ -9078,7 +9062,7 @@ get urls(): ((URL | Link))[] { let v = this.#_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_446xEaDBs3Fz6MyzP3PSBaLupkbJ_announceAuthorization.has(0)) { v = v.id; } @@ -13706,7 +13690,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -13957,7 +13941,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -15367,7 +15351,7 @@ instruments?: (Object | URL)[];} let v = this.#_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(0)) { v = v.id; } @@ -15474,8 +15458,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2DjTTboo3CNHU2a2JQqUSE2dbv9D_actor.has(i)) { v = v.id; } @@ -15706,7 +15689,7 @@ instruments?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -15813,8 +15796,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -16048,7 +16030,7 @@ instruments?: (Object | URL)[];} let v = this.#_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(0)) { v = v.id; } @@ -16158,8 +16140,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3JQCmF2Ww56Ag9EWRYoSZRDNCYtF_target.has(i)) { v = v.id; } @@ -16390,7 +16371,7 @@ instruments?: (Object | URL)[];} let v = this.#_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(0)) { v = v.id; } @@ -16497,8 +16478,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_u4QGFbRFcYmPEKGbPv1hpBR9r5G_result.has(i)) { v = v.id; } @@ -16730,7 +16710,7 @@ instruments?: (Object | URL)[];} let v = this.#_25zu2s3VxVujgEKqrDycjE284XQR_origin[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(0)) { v = v.id; } @@ -16838,8 +16818,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_25zu2s3VxVujgEKqrDycjE284XQR_origin.has(i)) { v = v.id; } @@ -17069,7 +17048,7 @@ instruments?: (Object | URL)[];} let v = this.#_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(0)) { v = v.id; } @@ -17175,8 +17154,7 @@ instruments?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3c5t2x7DYRo2shwTxpkd4kYSS5WQ_instrument.has(i)) { v = v.id; } @@ -20005,7 +19983,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -20232,7 +20210,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -22935,7 +22913,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -23162,7 +23140,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -24357,7 +24335,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -24584,7 +24562,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -25778,7 +25756,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2114kRKbujWhxEUghdkRYYKbXTGi_interactingObject.has(0)) { v = v.id; } @@ -26005,7 +25983,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2wHyG75YnN15CDMaFk3VNjByu4aL_interactionTarget.has(0)) { v = v.id; } @@ -28173,7 +28151,7 @@ cryptosuite?: "eddsa-jcs-2022" | null;verificationMethod?: Multikey | URL | null let v = this.#_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mHVKxqA7zncjveJrDEo3pWpMZqg_verificationMethod.has(0)) { v = v.id; } @@ -29180,7 +29158,7 @@ owner?: Application | Group | Organization | Person | Service | URL | null;publi let v = this.#_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_5UJq9NDh3ZHgswFwwdVxQvJxdx2_owner.has(0)) { v = v.id; } @@ -30095,7 +30073,7 @@ controller?: Application | Group | Organization | Person | Service | URL | null; let v = this.#_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2yr3eUBTP6cNcyaxKzAXWjFsnGzN_controller.has(0)) { v = v.id; } @@ -35923,7 +35901,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -36027,8 +36005,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -36260,7 +36237,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -36368,8 +36345,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -36638,7 +36614,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -36883,7 +36859,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -37114,7 +37090,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -37348,7 +37324,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -37580,7 +37556,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -37810,7 +37786,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -38040,7 +38016,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -38267,8 +38243,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -38607,7 +38582,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -38873,7 +38848,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -38981,8 +38956,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -39214,7 +39188,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -39322,8 +39296,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -42650,7 +42623,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -42901,7 +42874,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -45858,7 +45831,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3UyUdxnyn6cDn53QKrh4MBiearma_current[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3UyUdxnyn6cDn53QKrh4MBiearma_current.has(0)) { v = v.id; } @@ -46086,7 +46059,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_J52RqweMe6hhv7RnLJMC8BExTE5_first[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_J52RqweMe6hhv7RnLJMC8BExTE5_first.has(0)) { v = v.id; } @@ -46314,7 +46287,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gyJJnyEFnuNVi1HFZKfAn3Hfn26_last.has(0)) { v = v.id; } @@ -46551,8 +46524,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -46781,7 +46753,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4TB9Qd9ddtcZEpMfzbHhzafE6jaJ_likesOf.has(0)) { v = v.id; } @@ -47008,7 +46980,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3manzgeKiPsugpztKGiaUUwJ3ito_sharesOf.has(0)) { v = v.id; } @@ -47235,7 +47207,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3T3oGm3twpcQUcrnMisXQtmDZ32X_repliesOf.has(0)) { v = v.id; } @@ -47462,7 +47434,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bvRkAFZjMfVD8jiUWZJr5YokSeN_inboxOf.has(0)) { v = v.id; } @@ -47689,7 +47661,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4AHzVZDxHjK6uEWa9UiKHGK34yYm_outboxOf.has(0)) { v = v.id; } @@ -47916,7 +47888,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41aoZ5M6yRUHy3Zx8q6iuZQxtopb_followersOf.has(0)) { v = v.id; } @@ -48143,7 +48115,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2nXT2Ah42UjEEQF5oJQ39CbKB1xj_followingOf.has(0)) { v = v.id; } @@ -48370,7 +48342,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2bsySzmT3qEZcrnoe3tZ5xBjXSju_likedOf.has(0)) { v = v.id; } @@ -50171,7 +50143,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2kWgBhQKjEauxx8C6qF3ZQamK4Le_partOf.has(0)) { v = v.id; } @@ -50397,7 +50369,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3BT4kQLcXhHx7TAWaNDKh8nFn9eY_next.has(0)) { v = v.id; } @@ -50624,7 +50596,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3b8yG8tDNzQFFEnWhCc13G8eHooA_prev.has(0)) { v = v.id; } @@ -55633,7 +55605,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -55737,8 +55709,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -55970,7 +55941,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -56078,8 +56049,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -56348,7 +56318,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -56593,7 +56563,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -56824,7 +56794,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -57058,7 +57028,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -57290,7 +57260,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -57520,7 +57490,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -57750,7 +57720,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -57977,8 +57947,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -58317,7 +58286,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -58583,7 +58552,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -58691,8 +58660,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -58924,7 +58892,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -59032,8 +59000,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -62047,8 +62014,7 @@ get names(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_gCVTegXxWWCw6wWRxa1QF65zusg_preview.has(i)) { v = v.id; } @@ -66879,7 +66845,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -67130,7 +67096,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -68035,8 +68001,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -68808,8 +68773,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2JPCKWTcfBmTCcW8Tv3TpRaLVaqg_items.has(i)) { v = v.id; } @@ -70517,7 +70481,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -70621,8 +70585,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -70854,7 +70817,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -70962,8 +70925,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -71232,7 +71194,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -71477,7 +71439,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -71708,7 +71670,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -71942,7 +71904,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -72174,7 +72136,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -72404,7 +72366,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -72634,7 +72596,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -72861,8 +72823,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -73201,7 +73162,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -73467,7 +73428,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -73575,8 +73536,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -73808,7 +73768,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -73916,8 +73876,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -77717,7 +77676,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -77821,8 +77780,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -78054,7 +78012,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -78162,8 +78120,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -78432,7 +78389,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -78677,7 +78634,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -78908,7 +78865,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -79142,7 +79099,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -79374,7 +79331,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -79604,7 +79561,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -79834,7 +79791,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -80061,8 +80018,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -80401,7 +80357,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -80667,7 +80623,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -80775,8 +80731,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -81008,7 +80963,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -81116,8 +81071,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } @@ -84711,7 +84665,7 @@ proofs?: (DataIntegrityProof | URL)[];interactionPolicy?: InteractionPolicy | nu let v = this.#_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3CLQ1PLSXrhSQbTGGHuxNyaEFKM1_describes.has(0)) { v = v.id; } @@ -85631,8 +85585,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2N5scKaVEcdYHFmfKYYacAwUhUgQ_oneOf.has(i)) { v = v.id; } @@ -85863,8 +85816,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2mV6isMTPRKbWdLCjcpiEysq5dAY_anyOf.has(i)) { v = v.id; } @@ -86125,7 +86077,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3obhVLFML2Fh2Qsbg3BM2dec8S9e_quote.has(0)) { v = v.id; } @@ -86376,7 +86328,7 @@ instruments?: (Object | URL)[];exclusiveOptions?: (Object | URL)[];inclusiveOpti let v = this.#_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_ZKAEiJeuEvjeYkC4pG58D5vAJ4m_quoteAuthorization.has(0)) { v = v.id; } @@ -88337,7 +88289,7 @@ relationships?: (Object | URL)[];} let v = this.#_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2Zqdmi46ZnDQsECS6mzwhrv3rUKq_subject.has(0)) { v = v.id; } @@ -88564,7 +88516,7 @@ relationships?: (Object | URL)[];} let v = this.#_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(0)) { v = v.id; } @@ -88669,8 +88621,7 @@ relationships?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MH19yxjn1wnHsNfa5n4JBhJzxyc_object.has(i)) { v = v.id; } @@ -88901,7 +88852,7 @@ relationships?: (Object | URL)[];} let v = this.#_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(0)) { v = v.id; } @@ -89008,8 +88959,7 @@ relationships?: (Object | URL)[];} let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Lzz89F9qipAQSGkWyX9DGWiUojG_relationship.has(i)) { v = v.id; } @@ -91159,7 +91109,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_axq166E2eZADq34V4MYUc8KMZdC_publicKey[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(0)) { v = v.id; } @@ -91263,8 +91213,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_axq166E2eZADq34V4MYUc8KMZdC_publicKey.has(i)) { v = v.id; } @@ -91496,7 +91445,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(0)) { v = v.id; } @@ -91604,8 +91553,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4EHQFWZSz1k1d4LmPrQiMba2GbP3_assertionMethod.has(i)) { v = v.id; } @@ -91874,7 +91822,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3ghX3VfZXXbLvhCRH7QJqpzLrXjB_inbox.has(0)) { v = v.id; } @@ -92119,7 +92067,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_41QwhqJouoLg3h8dRPKat21brynC_outbox[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_41QwhqJouoLg3h8dRPKat21brynC_outbox.has(0)) { v = v.id; } @@ -92350,7 +92298,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3yAv8jymNfNuJUDuBzJ1NQhdbAee_following.has(0)) { v = v.id; } @@ -92584,7 +92532,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_BBCTgfphhsFzpVfKTykGSpBNwoA_followers[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_BBCTgfphhsFzpVfKTykGSpBNwoA_followers.has(0)) { v = v.id; } @@ -92816,7 +92764,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3bgkPwJanyTCoVFM9ovRcus8tKkU_liked.has(0)) { v = v.id; } @@ -93046,7 +92994,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4N1vBJzXDf8NbBumeECQMFvKetja_featured[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4N1vBJzXDf8NbBumeECQMFvKetja_featured.has(0)) { v = v.id; } @@ -93276,7 +93224,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2MxnRRLq9iPzx5CFq2NPrXdUDCac_featuredTags.has(0)) { v = v.id; } @@ -93503,8 +93451,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3sG2Hdwn9qzKGu9mpYkqakAMUkH9_streams.has(i)) { v = v.id; } @@ -93843,7 +93790,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_2ZNWDhuNdSXBwEmrB5kwffdKGzok_movedTo.has(0)) { v = v.id; } @@ -94109,7 +94056,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(0)) { v = v.id; } @@ -94217,8 +94164,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_3NV7TGNhuABbryNjNi4wib4DgNpY_alsoKnownAs.has(i)) { v = v.id; } @@ -94450,7 +94396,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = this.#_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(0)) { v = v.id; } @@ -94558,8 +94504,7 @@ get preferredUsernames(): ((string | LanguageString))[] { let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.#_trust_4Q6NrKH6bazBGtxwG8vyG77ir7Tg_service.has(i)) { v = v.id; } diff --git a/packages/vocab-tools/src/property.ts b/packages/vocab-tools/src/property.ts index faa1e20c5..28bcbfbfb 100644 --- a/packages/vocab-tools/src/property.ts +++ b/packages/vocab-tools/src/property.ts @@ -277,7 +277,7 @@ async function* generateProperty( let v = this.${await getFieldName(property.uri)}[0]; if (!(v instanceof URL) && v.id != null && - (this.id == null || !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.${await getFieldName(property.uri, "#_trust")}.has(0)) { v = v.id; } @@ -383,8 +383,7 @@ async function* generateProperty( let v = vs[i]; if (!(v instanceof URL) && v.id != null && - (this.id == null || - !isTrustedIriOrigin(options, v.id, this.id)) && + !isTrustedIriOrigin(options, v.id, this.id) && !this.${await getFieldName(property.uri, "#_trust")}.has(i)) { v = v.id; } diff --git a/packages/vocab/src/vocab.test.ts b/packages/vocab/src/vocab.test.ts index 831ba8845..bd7c80fa2 100644 --- a/packages/vocab/src/vocab.test.ts +++ b/packages/vocab/src/vocab.test.ts @@ -3455,6 +3455,31 @@ test("FEP-fe34: crossOrigin trust behavior", async () => { deepStrictEqual(result?.content, "This is a spoofed note"); }); +test("FEP-fe34: id-less owners honor crossOrigin trust", async () => { + const create = await Create.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + "@type": "Create", + "actor": "https://example.com/actor", + "object": { + "@type": "Note", + "@id": "https://different-origin.com/note", + "content": "Embedded note", + }, + }); + + const result = await create.getObject({ + crossOrigin: "trust", + // deno-lint-ignore require-await + documentLoader: async (url) => { + throw new Error(`Unexpected fetch: ${url}`); + }, + }); + + assertInstanceOf(result, Note); + deepStrictEqual(result.id, new URL("https://different-origin.com/note")); + deepStrictEqual(result.content, "Embedded note"); +}); + test("FEP-fe34: Same origin objects are trusted", async () => { // deno-lint-ignore require-await const sameOriginDocumentLoader = async (url: string) => { @@ -3747,6 +3772,44 @@ test("FEP-fe34: Array properties with crossOrigin trust option", async () => { deepStrictEqual((items[1] as Note).content, "Legitimate note 2"); }); +test("FEP-fe34: id-less arrays honor crossOrigin trust", async () => { + const collection = await Collection.fromJsonLd({ + "@context": "https://www.w3.org/ns/activitystreams", + "@type": "Collection", + "items": [ + { + "@type": "Note", + "@id": "https://different-origin.com/note1", + "content": "Embedded note 1", + }, + { + "@type": "Note", + "@id": "https://different-origin.com/note2", + "content": "Embedded note 2", + }, + ], + }); + + const items = []; + for await ( + const item of collection.getItems({ + crossOrigin: "trust", + // deno-lint-ignore require-await + documentLoader: async (url) => { + throw new Error(`Unexpected fetch: ${url}`); + }, + }) + ) { + items.push(item); + } + + deepStrictEqual(items.length, 2); + assertInstanceOf(items[0], Note); + assertInstanceOf(items[1], Note); + deepStrictEqual((items[0] as Note).content, "Embedded note 1"); + deepStrictEqual((items[1] as Note).content, "Embedded note 2"); +}); + test("FEP-fe34: Array properties track trust per item", async () => { const collection = new Collection({ id: new URL("https://example.com/collection"), From fb47477938510df377c5fe96b4f1d741842222eb Mon Sep 17 00:00:00 2001 From: Hong Minhee Date: Fri, 3 Jul 2026 02:16:46 +0900 Subject: [PATCH 55/55] Preserve explicit null JSON-LD contexts Explicit null contexts reset inherited terms, so cache recompaction should not apply parent aliases to those nested objects. https://github.com/fedify-dev/fedify/pull/850#discussion_r3514899845 Assisted-by: Codex:gpt-5.5 --- .../src/internal/jsonld-cache.ts | 42 +++++++++++++++---- .../vocab-runtime/src/jsonld-cache.test.ts | 31 ++++++++++++++ 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/packages/vocab-runtime/src/internal/jsonld-cache.ts b/packages/vocab-runtime/src/internal/jsonld-cache.ts index ad1e2357a..190ad7595 100644 --- a/packages/vocab-runtime/src/internal/jsonld-cache.ts +++ b/packages/vocab-runtime/src/internal/jsonld-cache.ts @@ -2,6 +2,8 @@ import type { DocumentLoader } from "../docloader.ts"; import jsonld from "../jsonld.ts"; import { formatIri, haveSameIriOrigin } from "../url.ts"; +const noJsonLdContext = Symbol("noJsonLdContext"); + /** * Options for deciding whether two IRIs should be treated as same-origin. * @@ -142,12 +144,12 @@ export function getJsonLdContext(value: unknown, depth = 0): unknown { return (value as Record)["@context"]; } -function getOwnJsonLdContext(value: unknown): unknown { +function getOwnJsonLdContext(value: unknown): unknown | typeof noJsonLdContext { if ( value == null || typeof value !== "object" || Array.isArray(value) || !("@context" in value) ) { - return undefined; + return noJsonLdContext; } return (value as Record)["@context"]; } @@ -195,7 +197,9 @@ export async function compactJsonLdCache( return clone ?? (Array.isArray(normalized) ? normalized : normalizedArray); } const ownContext = getOwnJsonLdContext(original); - const context = ownContext ?? inheritedContext; + const context = ownContext === noJsonLdContext + ? inheritedContext + : ownContext; if (context == null) { return preserveNoContextJsonLdShape(normalized, original, depth); } @@ -462,21 +466,26 @@ async function preserveJsonLdShape( } if (Array.isArray(compacted)) return compacted; let clone: Record | undefined; + const ownContext = getOwnJsonLdContext(original); + const objectContext = combineContexts(context, ownContext); + const objectCompacted = depth > 0 && ownContext === null + ? await compactWithEmptyContext(compacted, context, documentLoader) + : compacted; const compactedObject = depth > 0 ? await mergeUnmappedTerms( - compacted, + objectCompacted, original, - combineContexts(context, getOwnJsonLdContext(original)), + objectContext, documentLoader, ) as Record - : compacted as Record; + : objectCompacted as Record; const originalObject = original as Record; for (const key of globalThis.Object.keys(compactedObject)) { if (key === "@context") continue; const value = await preserveJsonLdShape( compactedObject[key], originalObject[key], - context, + objectContext, documentLoader, depth + 1, ); @@ -497,13 +506,30 @@ async function preserveJsonLdShape( return clone ?? compactedObject; } +async function compactWithEmptyContext( + compacted: unknown, + context: unknown, + documentLoader?: DocumentLoader, +): Promise { + const compactedWithContext = compacted != null && + typeof compacted === "object" && !Array.isArray(compacted) && + !("@context" in compacted) + ? { "@context": context, ...compacted as Record } + : compacted; + const expanded = await jsonld.expand(compactedWithContext, { + documentLoader, + }); + return await jsonld.compact(expanded, {}, { documentLoader }); +} + function combineContexts( inheritedContext: unknown, ownContext: unknown, ): unknown { - if (ownContext == null || ownContext === inheritedContext) { + if (ownContext === noJsonLdContext || ownContext === inheritedContext) { return inheritedContext; } + if (ownContext == null) return ownContext; const inherited = Array.isArray(inheritedContext) ? inheritedContext : [inheritedContext]; diff --git a/packages/vocab-runtime/src/jsonld-cache.test.ts b/packages/vocab-runtime/src/jsonld-cache.test.ts index 9bde0476e..6f95fde19 100644 --- a/packages/vocab-runtime/src/jsonld-cache.test.ts +++ b/packages/vocab-runtime/src/jsonld-cache.test.ts @@ -435,6 +435,37 @@ test("compactJsonLdCache() preserves nested array contexts", async () => { }); }); +test("compactJsonLdCache() preserves nested null contexts", async () => { + const context = { + as: "https://www.w3.org/ns/activitystreams#", + id: "@id", + type: "@type", + attachment: { "@id": "as:attachment" }, + title: "https://example.com/ns#title", + }; + const original = { + "@context": context, + type: "as:Note", + id: "ap://did:key:z6Mkabc/objects/1", + attachment: { + "@context": null, + "https://example.com/ns#title": "Absolute title.", + }, + }; + const expanded = await jsonld.expand(original); + const normalized = normalizeJsonLdIris(expanded, new Set(["@id"])); + + deepStrictEqual(await compactJsonLdCache(normalized, original), { + "@context": context, + type: "as:Note", + id: "ap+ef61://did:key:z6Mkabc/objects/1", + attachment: { + "@context": null, + "https://example.com/ns#title": "Absolute title.", + }, + }); +}); + test("compactJsonLdCache() does not re-add represented nested aliases", async () => { const context = { as: "https://www.w3.org/ns/activitystreams#",